Android ImageView centerCrop does not work. Skews instead of scaling

I am currently working on a navigation box where I want the user's photo to be scaled, cropped, darkened, and then used as the header image behind the circular crop image.

I can’t even send images because this account is too low ... damn me and using my old account for most of my questions ...

Even though my ImageView is defined as follows

 <ImageView android:tint="@color/clyp_copy" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/pixplogo" android:scaleType="centerCrop" android:adjustViewBounds="true"/> 

This image (1) jumps like this (2) (same link, two images)

This is a common problem for me. I never got centerCrop to work properly. I do not understand why.

Testing on 5.1.1, building on SDK 23. The same problem on 21

Not sure if this is allowed in SO, but here is apk debugging ... maybe this is just my device ... or 5.x

+5
source share
1 answer

Replace

 android:background="@drawable/pixplogo" 

with

 android:src="@drawable/pixplogo" 
+15
source

Source: https://habr.com/ru/post/1232420/


All Articles