UIImageView 的contentMode属性
2016-06-28 10:49
651 查看
UIViewContentModeScaleToFill
UIViewContentModeScaleAspectFit
UIViewContentModeScaleAspectFill
UIViewContentModeRedraw
UIViewContentModeCenter
UIViewContentModeTop
UIViewContentModeBottom
UIViewContentModeLeft
UIViewContentModeRight
UIViewContentModeTopLeft
UIViewContentModeTopRight
UIViewContentModeBottomLeft
UIViewContentModeBottomRight
注意以上几个常量,凡是没有带Scale的,当图片尺寸超过
ImageView尺寸时,只有部分显示在ImageView中。UIViewContentModeScaleToFill属性会导致图片变形。UIViewContentModeScaleAspectFit会保证图片比例不变,而且全部显示在ImageView中,这意味着ImageView会有部分空白。UIViewContentModeScaleAspectFill也会证图片比例不变,但是是填充整个ImageView的,可能只有部分图片显示出来。
UIViewContentModeScaleAspectFit
UIViewContentModeScaleAspectFill
UIViewContentModeRedraw
UIViewContentModeCenter
UIViewContentModeTop
UIViewContentModeBottom
UIViewContentModeLeft
UIViewContentModeRight
UIViewContentModeTopLeft
UIViewContentModeTopRight
UIViewContentModeBottomLeft
UIViewContentModeBottomRight
注意以上几个常量,凡是没有带Scale的,当图片尺寸超过
ImageView尺寸时,只有部分显示在ImageView中。UIViewContentModeScaleToFill属性会导致图片变形。UIViewContentModeScaleAspectFit会保证图片比例不变,而且全部显示在ImageView中,这意味着ImageView会有部分空白。UIViewContentModeScaleAspectFill也会证图片比例不变,但是是填充整个ImageView的,可能只有部分图片显示出来。
相关文章推荐
- Android酷炫实用的开源框架(UI框架)
- UITableViewCell的分割线去除多余15px
- SQL queries contain complex joins, subqueries, and some aggregates
- 303. Range Sum Query - Immutable
- iOS中UIButton的setImage方法和setBackgroundImage方法区别
- 新建drools项目后报 value '1.8' is not a valid language level错误
- (rwbuilder.conf) 14374587 Post Patch Instructions Would Get Overridden By Autoconfig
- UESTC 92 Journey(LCA)
- UI组件
- UIResponder学习
- UITouch 触摸事件处理(实例)
- UESTC 86 Divide (二进制贪心)
- 关于更新Android sdk之后出现This Android SDK requires Android Developer Toolkit version 23.0.0 or above的解决方法
- post和get在request中,有一个body字段的差别
- 巧用UIResponder进行事件传递
- 获取图片指定点的RGBA
- OPatch cannot process overlay patches because of no OUI support
- iOS开发--- UIScrollView属性以及代理大全
- UESTC 84 Binary Operations(算贡献求期望)
- iOS设备UUID的获取方法(不变的唯一值)