What is the difference between 'center' and 'centerCrop' in the "ImageView"?

Viewed 3809

1-android:scaleTaype="center"

2-android:scaleTaype="centerCrop"

What is the difference between 1 and 2?

1 Answers

CENTER :- Center the image in the view, but perform no scaling.

enter image description here

CENTER_CROP :- 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. enter image description here

Refer to this official documentation for a overview of all the ScaleTypes and this site for a detailed explanation

Related