2016.01.19 UIImageView
2016-01-20 18:54
459 查看
UIImageView是在界面上显示图片的一个控件。
1.contentMode
当图片的大小和控件的大小不一致的时候,就会调用到这个属性。这个属性是用来设置图片的显示方式,如居中、居右,是否缩放等,有以下几个常量可供设定:
UIViewContentModeScaleToFill : 拉伸填充到整个控件大小
UIViewContentModeScaleAspectFit 保持图片的原始比例缩放,保证整个图片都在空间中的前提,横向或纵向一方填满整个屏幕
UIViewContentModeScaleAspectFill 保持图片的原始比例,填满整个控件
UIViewContentModeRedraw 这个还不太清楚,感觉上和scaleToFill一样
UIViewContentModeCenter 从这开始的都是保持图片原始的尺寸不变而进行『对齐』
UIViewContentModeTop
UIViewContentModeBottom
UIViewContentModeLeft
UIViewContentModeRight
UIViewContentModeTopLeft
UIViewContentModeTopRight
UIViewContentModeBottomLeft
UIViewContentModeBottomRight
2.animationImages
这个是播放一个系列的图片是需要调用的。
eg:fjImageView.animationImages = imagesArray; (等号右边一定是一个数组,数组中保存的均是UIImageView)
3.animationDuration
这个表示的是播放这个系列图片所需要的时间。
eg:fjImageView.animationDuration = 2;
3.animationRepeatCount
从字面上理解就能知道,这个是重复的次数,为零时表示一直循环。
eg:fjImageView.animationRepeatCount = 0;
P.S. 别忘了在最后面加上 [fjImageView startAnimating];
1.contentMode
当图片的大小和控件的大小不一致的时候,就会调用到这个属性。这个属性是用来设置图片的显示方式,如居中、居右,是否缩放等,有以下几个常量可供设定:
UIViewContentModeScaleToFill : 拉伸填充到整个控件大小
UIViewContentModeScaleAspectFit 保持图片的原始比例缩放,保证整个图片都在空间中的前提,横向或纵向一方填满整个屏幕
UIViewContentModeScaleAspectFill 保持图片的原始比例,填满整个控件
UIViewContentModeRedraw 这个还不太清楚,感觉上和scaleToFill一样
UIViewContentModeCenter 从这开始的都是保持图片原始的尺寸不变而进行『对齐』
UIViewContentModeTop
UIViewContentModeBottom
UIViewContentModeLeft
UIViewContentModeRight
UIViewContentModeTopLeft
UIViewContentModeTopRight
UIViewContentModeBottomLeft
UIViewContentModeBottomRight
2.animationImages
这个是播放一个系列的图片是需要调用的。
eg:fjImageView.animationImages = imagesArray; (等号右边一定是一个数组,数组中保存的均是UIImageView)
3.animationDuration
这个表示的是播放这个系列图片所需要的时间。
eg:fjImageView.animationDuration = 2;
3.animationRepeatCount
从字面上理解就能知道,这个是重复的次数,为零时表示一直循环。
eg:fjImageView.animationRepeatCount = 0;
P.S. 别忘了在最后面加上 [fjImageView startAnimating];
相关文章推荐
- 纯代码实现UITableViewCell的折叠效果
- 分享拼图响应式后台pintuer V1.2
- EasyUI DataGrid的loadFilter属性使用
- Uiautomator2和Uiautomator的区别
- moo 11 request
- iOS开发 贝塞尔曲线UIBezierPath
- GPUImage
- Codeforces 570D Tree Requests 题解&代码
- EasyUI DataGrid中loadFilter 属性的用法
- Android中的Build类
- poj3368&hdu1806Frequent values【RMQ求频率】
- [Deeplearning]5监测学习过程(from A practical guide to training restricted boltzmann machine)
- ios 手写键盘闪退问题 UIKBBlurredKeyView candidateList
- datagrid easyui 数据下面新增合计列
- 实现对UIAlertController和UIAlertView判断系统后的简单封装
- Animation动画详解(六)——ValueAnimator高级进阶(二)
- Zoho Recruit新界面赏析
- UIViewContentMode各类型效果
- ios9-NSLayoutAnchor和UILayoutGuide实现自动布局
- response.sendRedirect()与request.getRequestDispatcher().forward()区别