Android ImageView centerCrop 不工作。倾斜而不是缩放

标签 android imageview scale crop

我目前正在开发一个抽屉导航,我希望用户照片在这里被缩放、裁剪、着色,然后用作图片圆形裁剪后面的标题图像。

我什至无法发布图片,因为这个帐户的知名度太低了...该死的我用我以前的学生帐户来解决我的大部分问题...

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

最佳答案

替换

android:background="@drawable/pixplogo"

android:src="@drawable/pixplogo"

关于Android ImageView centerCrop 不工作。倾斜而不是缩放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32813840/

相关文章:

Android,无法读取我保存到数据文件夹的图像

android - ConstraintSet 中的 setHorizo​​ntalBias 以及以编程方式创建的 View

android - 如何使用 android imageview 应用程序打开可绘制文件夹中的图像?

html - 背景图像在 iOS 上无法正确缩放

android - Intent.FLAG_ACTIVITY_CLEAR_TOP 和 android 中的 finish 有什么区别

java - 设置第一个 ListView 项目的布局

scale - 如何使用 gstreamer 更改纵横比?

android - 实际 View 的高度不适合适当的内容

android - Intentservice 不调用 runnable

java - Android:触摸 ImageView 时停止滚动?