M.younes
M.younes

Reputation: 29

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

1-android:scaleTaype="center"

2-android:scaleTaype="centerCrop"

What is the difference between 1 and 2?

Upvotes: 2

Views: 4937

Answers (1)

Mukul Kumar Jha
Mukul Kumar Jha

Reputation: 1082

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

Upvotes: 8

Related Questions