在layout文件中,设置IamgeView的最大(最小)高度(宽度)时,需要同时设置android:adjustViewBounds="true",这样设置才会生效。在代码中设置时,需要setAdjustViewBounds为true。一个layout的实例:
- android:adjustViewBounds="true"
- android:maxHeight="150.0dip"
- android:maxWidth="150.0dip"
- android:minHeight="33.0dip"
- android:minWidth="48.0dip"
本文介绍如何在Android布局文件中正确设置ImageView的最大和最小高度及宽度。要实现这些设置,需要使用android:adjustViewBounds属性并将其值设为true。此外,在代码中也需要调用setAdjustViewBounds方法并传入true参数。
8082

被折叠的 条评论
为什么被折叠?



