UIImageVIew属性值animationImages
2016-04-15 17:17
357 查看
animationImages是数组类型,改数组必须包含UIImage对象。每张图片可以看成是一帧动画。
NSMutableArray *tempArr = [NSMutableArray arrayWithArray:@[]];
for (int i = 0 ; i < 25; i ++) {
NSString *string = [NSString stringWithFormat:@"cat_angry%d.jpg", i];
UIImage *image = [UIImage imageNamed:string];
[tempArr addObject:image];
}
_imageview.animationImages = tempArr;
_imageview.animationRepeatCount = 0;//设置动画次数 0
表示无限
_imageview.animationDuration = 3;//设置动画时间
[_imageview startAnimating];//开始播放动画
效果是一个动态的小猫
NSMutableArray *tempArr = [NSMutableArray arrayWithArray:@[]];
for (int i = 0 ; i < 25; i ++) {
NSString *string = [NSString stringWithFormat:@"cat_angry%d.jpg", i];
UIImage *image = [UIImage imageNamed:string];
[tempArr addObject:image];
}
_imageview.animationImages = tempArr;
_imageview.animationRepeatCount = 0;//设置动画次数 0
表示无限
_imageview.animationDuration = 3;//设置动画时间
[_imageview startAnimating];//开始播放动画
效果是一个动态的小猫
相关文章推荐
- C#—Stack和Queue泛型使用
- [CodeForces 566F] Clique in the Divisibility Graph (记忆化搜索)
- IOS开发中UITableView(表视图)的滚动优化及自定义Cell
- CF 266B Queue at the School (人生第一道B题)
- 【原创】Silverlight客户端发起WebRequest请求分析
- 透明UIView图设置
- UIView的常用属性
- EFI、UEFI、MBR、GPT的区别
- EFI、UEFI、MBR、GPT的区别
- EFI、UEFI、MBR、GPT的区别
- EFI、UEFI、MBR、GPT的区别
- Java. Warning – Build path specifies execution environment J2SE-1.6
- pt-query-digest查询日志分析工具
- 【Vue】-(1) 安装
- nav-blue
- Android之SystemUI加载流程和NavigationBar的分析
- 太原UI设计师教你如何在千万张图片中选择图像素材的技巧
- @WebServlet 注解value少了左斜线-导致报错--Exception starting Context with name
- 设置UITableView的单元格分割线离屏幕左右的距离为0
- 快速设置UINavbar的属性包括背景 title的颜色字体以及改变返回键的图片