ScaleType
class ScaleType
kotlin.Any | ||
↳ | kotlin.Enum<android.widget.ImageView.ScaleType> | |
↳ | android.widget.ImageView.ScaleType |
Options for scaling the bounds of an image to the bounds of this view.
Summary
Enum values | |
---|---|
Center the image in the view, but perform no scaling. |
|
Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding). |
|
Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding). |
|
Scale the image using |
|
Scale the image using |
|
Scale the image using |
|
Scale the image using |
|
Scale using the image matrix when drawing. |
Enum values
CENTER
enum val CENTER : ImageView.ScaleType
Center the image in the view, but perform no scaling. From XML, use this syntax: android:scaleType="center"
.
CENTER_CROP
enum val CENTER_CROP : ImageView.ScaleType
Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding). The image is then centered in the view. From XML, use this syntax: android:scaleType="centerCrop"
.
CENTER_INSIDE
enum val CENTER_INSIDE : ImageView.ScaleType
Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding). The image is then centered in the view. From XML, use this syntax: android:scaleType="centerInside"
.
FIT_CENTER
enum val FIT_CENTER : ImageView.ScaleType
Scale the image using Matrix.ScaleToFit#CENTER
. From XML, use this syntax: android:scaleType="fitCenter"
.
FIT_END
enum val FIT_END : ImageView.ScaleType
Scale the image using Matrix.ScaleToFit#END
. From XML, use this syntax: android:scaleType="fitEnd"
.
FIT_START
enum val FIT_START : ImageView.ScaleType
Scale the image using Matrix.ScaleToFit#START
. From XML, use this syntax: android:scaleType="fitStart"
.
FIT_XY
enum val FIT_XY : ImageView.ScaleType
Scale the image using Matrix.ScaleToFit#FILL
. From XML, use this syntax: android:scaleType="fitXY"
.
MATRIX
enum val MATRIX : ImageView.ScaleType
Scale using the image matrix when drawing. The image matrix can be set using ImageView#setImageMatrix(Matrix)
. From XML, use this syntax: android:scaleType="matrix"
.