UIImageView 的contentMode属性
2016-04-27 14:45
387 查看
UIImageView 的contentMode属性
UIViewContentModeScaleToFillUIViewContentModeScaleAspectFit
UIViewContentModeScaleAspectFill
UIViewContentModeRedraw
UIViewContentModeCenter
UIViewContentModeTop
UIViewContentModeBottom
UIViewContentModeLeft
UIViewContentModeRight
UIViewContentModeTopLeft
UIViewContentModeTopRight
UIViewContentModeBottomLeft
UIViewContentModeBottomRight
注意以上几个常量,凡是没有带Scale的,当图片尺寸超过
ImageView尺寸时,只有部分显示在ImageView中。UIViewContentModeScaleToFill属性会导致图片变形。
UIViewContentModeScaleAspectFit会保证图片比例不变,而且全部显示在ImageView中,这意味着ImageView
会有部分空白。UIViewContentModeScaleAspectFill也会证图片比例不变,但是是填充整个ImageView的,可能只有部
分图片显示出来。
相关文章推荐
- jquey ajax 发送数组
- 【Vue】 (10) 组件-2
- iOS 获取view的controller UIView+UIViewController
- request.getParameterMap();
- Android酷炫实用的开源框架(UI框架)
- 2016.04.27,英语,《Vocabulary Builder》Unit 19
- robot framework-requests库安装问题解决
- String,StringBuffer与StringBuilder的区别??
- StringBuilder类为何比string的简单拼接效率高
- Cannot run program "/home/user/Android/Sdk/build-tools/23.0.2/aapt": error=2 No such file or directo
- LigerUI用Post\Get\Ajax前后台交互方式的写发
- GUI for git|SourceTree|入门基础
- LigerUI之grid表格点击表头标题排序实现
- 62-形参return value
- Ligerui之grid表格的dataAction的local和server的区别
- ue4 RepNotify ReplicatedUsing 区别
- 初始化UIView的两种方式
- Java源码解析-BlockingQueue
- 设置UIButton中的文字和图片,设置UILabel的文在显示不同颜色
- 设置UIButton中的文字和图片,设置UILabel的文在显示不同颜色