首页 > 移动平台 > 详细

IOS UIImageView的contentMode属性

时间:2016-07-08 15:20:29      阅读:227      评论:0      收藏:0      [点我收藏+]


红框表示imageView的frame,下面的图片是原图大小
UIViewContentModeScaleToFill,       默认,对图片进行拉伸处理(不是按比例),是充满bouns

技术分享

UIViewContentModeScaleAspectFit,      按原图比例进行拉伸,是图片完全展示在bouns

技术分享

UIViewContentModeScaleAspectFill,     按原图比例填充,使图片展示在bouns中,可能只显示部分

技术分享

UIViewContentModeRedraw,              // redraw on bounds change (calls -setNeedsDisplay)

技术分享     

UIViewContentModeCenter,            图片显示在imageview的正中间,原图大小

技术分享

UIViewContentModeTop,               图片显示在imageview的上部,原图大小

技术分享

UIViewContentModeBottom,            图片显示在imageview的下部,原图大小

技术分享

UIViewContentModeLeft,              图片显示在imageview的左部,原图大小

技术分享

 

UIViewContentModeRight,             图片显示在imageview的右部,原图大小

技术分享

 

UIViewContentModeTopLeft,           图片显示在imageview的左上部,原图大小

 技术分享

 

UIViewContentModeTopRight,          图片显示在imageview的右上部,原图大小

 技术分享

 

UIViewContentModeBottomLeft,        图片显示在imageview的左下部,原图大小

 技术分享

 

UIViewContentModeBottomRight,       图片显示在imageview的右下部,原图大小

技术分享

 

IOS UIImageView的contentMode属性

原文:http://www.cnblogs.com/zhhl/p/5653269.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!