iOS网络请求动画
2016-05-12 11:40
525 查看
UIActivityIndicatorView *testActivityIndicator = [[UIActivityIndicatorViewalloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
testActivityIndicator.center =CGPointMake(100.0f,100.0f);//只能设置中
testActivityIndicator.frame =CGRectMake(0,0,
TRCBWidth,TRCBHeight);
[self.viewaddSubview:testActivityIndicator];
testActivityIndicator.color = [UIColorclearColor];
//改变圈圈的颜色为红色; iOS5引入
UIImageView *imageView = [[UIImageViewalloc]init];
imageView.frame =CGRectMake((TRCBWidth-90)/2,
(TRCBHeight-90)/3,90,
90);
[imageView
setBackgroundColor:[UIColorclearColor]];
//创建UIImageView,添加到界面
//创建一个数组,数组中按顺序添加要播放的图片(图片为静态的图片)
NSMutableArray *imgArray = [NSMutableArrayarray];
for (int i=0; i<3;
i++) {
UIImage *image1 = [UIImageimageNamed:[NSStringstringWithFormat:@"alan%d.png",i]];
[imgArray
addObject:image1];
}
//把存有UIImage的数组赋给动画图片数组
imageView.animationImages = imgArray;
//设置执行一次完整动画的时长
imageView.animationDuration =3*0.2;
//动画重复次数(0为重复播放)
imageView.animationRepeatCount =0;
//停止播放动画 - (void)stopAnimating;
//判断是否正在执行动画 - (BOOL)isAnimating;
[testActivityIndicator
addSubview:imageView];
[testActivityIndicator
startAnimating];//
开始旋转
[imageView startAnimating];//
开始旋转
testActivityIndicator.center =CGPointMake(100.0f,100.0f);//只能设置中
testActivityIndicator.frame =CGRectMake(0,0,
TRCBWidth,TRCBHeight);
[self.viewaddSubview:testActivityIndicator];
testActivityIndicator.color = [UIColorclearColor];
//改变圈圈的颜色为红色; iOS5引入
UIImageView *imageView = [[UIImageViewalloc]init];
imageView.frame =CGRectMake((TRCBWidth-90)/2,
(TRCBHeight-90)/3,90,
90);
[imageView
setBackgroundColor:[UIColorclearColor]];
//创建UIImageView,添加到界面
//创建一个数组,数组中按顺序添加要播放的图片(图片为静态的图片)
NSMutableArray *imgArray = [NSMutableArrayarray];
for (int i=0; i<3;
i++) {
UIImage *image1 = [UIImageimageNamed:[NSStringstringWithFormat:@"alan%d.png",i]];
[imgArray
addObject:image1];
}
//把存有UIImage的数组赋给动画图片数组
imageView.animationImages = imgArray;
//设置执行一次完整动画的时长
imageView.animationDuration =3*0.2;
//动画重复次数(0为重复播放)
imageView.animationRepeatCount =0;
//停止播放动画 - (void)stopAnimating;
//判断是否正在执行动画 - (BOOL)isAnimating;
[testActivityIndicator
addSubview:imageView];
[testActivityIndicator
startAnimating];//
开始旋转
[imageView startAnimating];//
开始旋转
相关文章推荐
- Android Https相关完全解析 当OkHttp遇到Https
- 虚拟机下使用NAT模式,主机模式配置Linux 网络ip
- AFNetworking3.xPost请求- “请求对象无法序列化”处理及:App Transport Security has blocked a cleartext HTTP (http://)
- http协议
- httpClient抓取页面的简易使用
- loadrunner简单使用——HTTP,WebService,Socket压力测试脚本编写
- [原] KVM虚拟机网络闪断分析
- OkHttp2.4.0在AS上使用
- c#网络编程之TCP/IP(一)C#线程任务基础Thread
- http 错误代码表
- Hadoop学习之网络爬虫+分词+倒排索引实现搜索引擎案例
- HttpURLConnection傻逼问题
- Android 开发框架之okhttp 网络框架的学习
- POJ 1087 A Plug for UNIX 网络流最大流
- HttpUtils+XStream解析
- web大文件上传控件-监控f_create流程-Xproer.HttpUploader6
- 强大的HTTP包装开源项目ASIHTTPRequest介绍
- [计算机网络] 作业(1)
- https模式下记住git密码
- APP HTTP接口报文的加密与压缩