Android ImageView centerCrop无法正常工作。倾斜而不是缩放 [英] Android ImageView centerCrop not working. Skewing instead of scaling

查看:296
本文介绍了Android ImageView centerCrop无法正常工作。倾斜而不是缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用导航抽屉,在其中我希望对用户的照片进行缩放,裁剪,着色,然后用作其中的圆形作物后面的标题图像。

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

尽管我的 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"/>

此图像(1)像这样歪斜(2)(相同链接,两个图像)

对我来说,这实际上是一个常见问题。我从来没有

Crop 正常工作。我不明白为什么。

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

在5.1.1上进行测试,基于SDK23。在21上出现同样的问题

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

不确定是否可以在SO上使用,但这是一个调试apk ...也许只是我的设备。 ..or 5.x

推荐答案

替换

android:background="@drawable/pixplogo"

android:src="@drawable/pixplogo"

这篇关于Android ImageView centerCrop无法正常工作。倾斜而不是缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆