Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ImageView centerCrop not working. Skewing instead of scaling

I'm currently working on a Navigation Drawer where I want the user photo to be scaled, cropped, tinted, then used as the header image behind a circular crop of there picture.

I can't even post images because this account is too low rep...damn me and using my old student account for most of my questions...

Despite my ImageView being defined like this

<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) skews like this (2) (Same link, two images)

This is actually a common issue for me. I've never gotten centerCrop to work properly. I don't understand why.

Testing on 5.1.1, building on SDK 23. Same issue on 21

Not sure if this is allowed on SO, but here's a Debug apk...maybe it's just my device...or 5.x

like image 658
Pixel Perfect Avatar asked Sep 27 '15 23:09

Pixel Perfect


1 Answers

Replace

android:background="@drawable/pixplogo"

with

android:src="@drawable/pixplogo"
like image 133
kris larson Avatar answered Sep 29 '22 04:09

kris larson