ImageView的android:maxHeight,android:minHeight的正确设置

在layout文件中,设置IamgeView的最大(最小)高度(宽度)时,需要同时设置android:adjustViewBounds="true",这样设置才会生效。在代码中设置时,需要setAdjustViewBounds为true。一个layout的实例:

 

[html]  view plain copy
  1. android:adjustViewBounds="true"  
  2. android:maxHeight="150.0dip"  
  3. android:maxWidth="150.0dip"  
  4. android:minHeight="33.0dip"  
  5. android:minWidth="48.0dip"  

你可能感兴趣的:(android,UI)