播放gif
2015-08-04 19:54
567 查看
// 播放gif图 self.tomcatImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)]; [self.view addSubview:self.tomcatImageView]; [self.tomcatImageView release]; // 对容器进行初始化 self.imgArr = [NSMutableArray array]; for (int i = 0; i < 26; i++) { // 拼接图片名称 NSString *imgName = [NSString stringWithFormat:@"angry_%02d.jpg", i]; // 根据名找到相应图片 UIImage *image = [UIImage imageNamed:imgName]; [self.imgArr addObject:image]; } // 设置播放图片的数组 self.tomcatImageView.animationImages = self.imgArr; // 设置图片切换的时间 self.tomcatImageView.animationDuration = 1.5; // 设置循环次数,0为最大 self.tomcatImageView.animationRepeatCount = 0; // 开始播放 [self.tomcatImageView startAnimating];
相关文章推荐
- Flume-NG之KafkaChannel
- oracle 简装版修改字符集
- Android SDK 在线更新镜像服务器资源
- erlang数据类型进程
- 阅读linux内核需要的名词注释
- 读书笔记之c和指针(2)
- hdu5348(2015多校5)--MZL's endless loop(搜索)
- POJ1006 Biorhythms
- HDU 4508 湫湫系列故事——减肥记I
- 26.手势识别器(UIGestureRecognizer)
- 毛玻璃效果
- 【Objective-C编程】浅析Objective-C的继承与复合
- IOS强制横竖屏幕切换总结续
- 详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!【2012-12-11日更新获取"产品付费数量等于0的问题"】
- 乘法逆元 & hdu 1576 A/B
- poj 3620 Avoid The Lakes
- Java数值交换(通过异或^来完成)
- opencv 2.4.11 cuda5.5 总结
- java面向对象编程之反射
- 【Unity3D ugui】使用艺术字