UIImageView 的contentMode属性
2015-09-14 08:54
447 查看
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的,可能只有部分图片显示出来。
相关文章推荐
- Burp Suite说明文档(1)20150312
- UI:用UITableView制作通讯录的关键代码
- N-Queens
- N-Queens II
- Unique Paths II
- Unique Paths
- atguigu.ssh-2.actions
- 使用GPUImage实现iOS 7的模糊效果
- [LeetCode#250] Count Univalue Subtrees
- UItableView之间的相互传值实现
- LeetCode Unique Paths II
- LeetCode Unique Paths II
- 【APUE】Chapter7 Process Environment
- Simple PWM to Analog Circuit (0-10vdc)
- how to generate an analog output from a in-built pwm of Atmega 32AVR microcontrloller?
- How to modify analog output range of Arduino Due
- 使用request.getParameter()读取参数时出现的中文乱码现象
- UI高级----Images.xcassets
- 用EasyUI的一些感受
- Android--Handler+Looper+MessageQueue+Thread线程之间的通信