MaxWidth和MaxHeight在ImageView中不起作用

时间:2014-12-08 19:52:40

标签: android

我在Android中使用ImageView,我最初将layout_heightlayout_width设置为wrap_content,并设置maxHeight和{{1属性。

这就是我的布局中的样子:

maxWidth

但是当我从图库中选择一张图片时,它会覆盖我的整个屏幕,忽略<ImageView android:id="@+id/profileImageView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:maxWidth="226dp" android:maxHeight="174dp" android:background="@drawable/photo" /> maxWidth。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:48)

添加android:adjustViewBounds="true"

相关问题