2015-09-27 108 views
5

我目前正在制作一个导航抽屉,在那里我要缩放,裁剪,着色,然后用作背景图片的圆形裁剪后的标题图像。Android ImageView centerCrop无法正常工作。歪斜而不是缩放

,因为这个帐户太低代表我甚至不能发表图片...该死的我,用我的旧的学生占大多数的我的问题......

尽管我ImageView被定义如下

<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)

这其实是我的一个常见的问题。我从来没有得到centerCrop正常工作。我不明白为什么。

测试5.1.1上,建立在SDK 23.同样的问题在21

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

回答

15

更换

android:background="@drawable/pixplogo" 

android:src="@drawable/pixplogo" 
+3

噢,我的天哪,我的白痴 –

+0

这发生在我身上的次数超过了我很自豪的承认。 –

+0

@ McSullivanD'Ander同样在这里,这就是我知道如何寻找:) –