图片数组形成动画(UIImageView)
2015-11-21 11:24
417 查看
图片数组形成动画(UIImageView)
UIImage *image = [UIImage imageNamed:@"iphone"];
//创建UIImageView来显示图片
self.firstImageView = [[UIImageView alloc] initWithImage:image];
self.firstImageView.frame = CGRectMake(100, 100, 79 , 106);
//图片动画
NSMutableArray *images = [NSMutableArray array];
for (int i = 1 ; i < 41; i++) {
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"2250_3650903_179fb89ae279fae-%d(被拖移).tiff",i]];
[images addObject:image];
}
//设置图片动画的图片数组
self.firstImageView.animationImages = images;
//设置图片动画的持续时间
self.firstImageView.animationDuration = 2;
//设置图片动画的重复次数(默认是0,代表无数次)
self.firstImageView.animationRepeatCount = 0;
//开始图片动画(停止用stop)
[self.firstImageView startAnimating];
UIImage *image = [UIImage imageNamed:@"iphone"];
//创建UIImageView来显示图片
self.firstImageView = [[UIImageView alloc] initWithImage:image];
self.firstImageView.frame = CGRectMake(100, 100, 79 , 106);
//图片动画
NSMutableArray *images = [NSMutableArray array];
for (int i = 1 ; i < 41; i++) {
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"2250_3650903_179fb89ae279fae-%d(被拖移).tiff",i]];
[images addObject:image];
}
//设置图片动画的图片数组
self.firstImageView.animationImages = images;
//设置图片动画的持续时间
self.firstImageView.animationDuration = 2;
//设置图片动画的重复次数(默认是0,代表无数次)
self.firstImageView.animationRepeatCount = 0;
//开始图片动画(停止用stop)
[self.firstImageView startAnimating];
相关文章推荐
- UIButton控件
- php 数组 array_values () array_key()
- CBuilder 添加自定义工具:打开当前文件所在的文件夹
- ue4中读取excel导出的二进制流文件
- php 数组 array_intersect_key() array_unique()移除重复
- 推荐一个Arduino学习模拟器: 123D Circuites
- UITableView
- poj1458Common Subsequence(求两个字符串的最长公共子序列)
- 我的iOS学习历程 - UISlider(简单的设置一组图片动画)
- 我的iOS学习历程 - UISlider(简单的设置一组图片动画)
- 优先队列priority_queue用法详解
- UIViewController的生命周期
- 初探UiAutomator(三)
- UITableView 初探
- 获得AndroidManifest.xml文件中meta-data的value值工具类
- 我的iOS学习历程 - UISegmentedControl
- 我的iOS学习历程 - UISegmentedControl
- Arduino - 正弦波数值的采样与应用
- UISearchView
- Android Builder模式分析(链式调用)