码迷,mamicode.com
首页 > 其他好文 > 详细

Imageview.setAdjustViewBounds用法

时间:2015-08-25 16:41:04      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:imageview.setadjustv

public void setAdjustViewBounds (boolean adjustViewBounds)

当你需要在 ImageView调整边框时保持可绘制对象的比例时,将该值设为真。

参数 adjustViewBounds         是否调整边框,以保持可绘制对象的原始比例。

相关 XML 属性              android:adjustViewBounds

 

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

 

版权声明:本文为博主原创文章,未经博主允许不得转载。

Imageview.setAdjustViewBounds用法

标签:imageview.setadjustv

原文地址:http://blog.csdn.net/dq1005/article/details/47977717

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!