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

查看:44
本文介绍了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 是这样定义的

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"/>

这张图片(1)像这样歪斜(2)(同一个链接,两张图片)

这对我来说实际上是一个常见问题.我从来没有让 centerCrop 正常工作.我不明白为什么.

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

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

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

不确定在 SO 上是否允许这样做,但这是一个调试 apk...也许它只是我的设备...或 5.x

推荐答案

替换

android:background="@drawable/pixplogo"

android:src="@drawable/pixplogo"

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

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