setAdjustViewBounds与setMaxHeight,setMaxWidth的作用

设置View的最大高度,单独使用无效,需要与setAdjustViewBounds一起使用.如果想设置图片固定大小,又想保持图片宽高比,需要如下设置:
1.设置setAdjustViewBounds为true;
2.设置setMaxHeight,setMaxWidth;
3.设置设置对应layout_width或layout_height为wrap_content.

posted @ 2014-10-23 11:02  半杯可乐  阅读(771)  评论(0编辑  收藏  举报