实例详析ImageView的adjustViewBonds和scaleType

android:adjustViewBounds
是否保持宽高比。需要与maxWidth、MaxHeight一起使用,否则单独使用没有效果。

设置View的最大高度,单独使用无效,需要与setAdjustViewBounds一起使用。如果想设置图片固定大小,又想保持图片宽高比,需要如下设置:
1) 设置setAdjustViewBounds为true;
2) 设置maxWidth、MaxHeight;
3) 设置设置layout_width和layout_height为wrap_content。

下面的blog重点分析scaleType属性

https://blog.csdn.net/ezconn/article/details/90289523

https://blog.csdn.net/love_xsq/article/details/43406741

posted @ 2017-06-28 15:52  庚拓天下  阅读(598)  评论(0编辑  收藏  举报