Android ImageView centerCrop not working. Skewing instead of scaling(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 不工作.倾斜而不是缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Android ImageView centerCrop 不工作.倾斜而不是缩放
基础教程推荐
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
