温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

ImageView.ScaleType 属性值

发布时间:2020-07-12 07:27:15 阅读:427 作者:510202 栏目:开发技术
开发者测试专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

ImageView.ScaleType属性值:

CENTER Center the p_w_picpath in the view, but perform no scaling.

 按图片的原来size居中显示,当图片长/宽超过View的长/宽,则截取图片的居中部分显示

CENTER_CROP Scale the p_w_picpath uniformly (maintain the p_w_picpath's aspect ratio) so that both dimensions (width and height) of the p_w_picpath will be equal to or larger than the corresponding dimension of the view (minus padding).

按比例扩大图片的size居中显示,使得图片长(宽)等于或大于View的长(宽)

CENTER_INSIDE Scale the p_w_picpath uniformly (maintain the p_w_picpath's aspect ratio) so that both dimensions (width and height) of the p_w_picpath will be equal to or less than the corresponding dimension of the view (minus padding).

将图片的内容完整居中显示,通过按比例缩小或原来的size使得图片长/宽等于或小于View的长/宽

FIT_CENTER Scale the p_w_picpath using CENTER.

 把图片按比例扩大/缩小到View的宽度,居中显示

FIT_END Scale the p_w_picpath using END.

 把图片按比例扩大/缩小到View的宽度,底部显示

FIT_START Scale the p_w_picpath using START.

 把图片按比例扩大/缩小到View的宽度,顶部显示

FIT_XY Scale the p_w_picpath using FILL.

 不按比例缩放图片,目标是把图片塞满整个View。

MATRIX Scale using the p_w_picpath matrix when drawing.

   当绘画的时候使用,使用矩阵。

Bitmap常用:

http://www.cnblogs.com/fighter/archive/2012/02/20/android-bitmap-drawable.html

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI

开发者交流群×