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 不工作.倾斜而不是缩放


- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01