UIActivityIndictorView的使用
来源:互联网 发布:淘宝订单接口 编辑:程序博客网 时间:2024/06/17 02:51
主要功能:
- 在应用程序中主要用于提示用户某些动作正在后台执行比如:网络请求,数据库操作等。
常用属性
UIActivityIndicatorViewStyle activityIndicatorViewStyle;//风格设置1.UIActivityIndicatorViewStyleWhiteLarge2.UIActivityIndicatorViewStyleWhite3.UIActivityIndicatorViewStyleWhiteBOOL hidesWhenStopped;//停止时隐藏视图,默认是YESUIColor *color;//修改指示器的颜色,注意版本问题
初始化方法
- (void)startAnimating;//开始动画
- (void)stopAnimating;//停止动画
- (void)isAnimating;//判断动画的状态(YES/NO)
#import "ViewController.h"@interface ViewController ()@property(strong,nonatomic)UIActivityIndicatorView *activity;@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; _activity = [[UIActivityIndicatorView alloc] initWithFrame: CGRectMake(0, 0, 40, 40)];//指定进度轮的大小 _activity.center = CGPointMake(160, 140);//指定进度轮的中心点 //设置进度轮的显示类型 [_activity setActivityIndicatorViewStyle: UIActivityIndicatorViewStyleGray]; [self.view addSubview:_activity];}- (IBAction)activityButton:(id)sender {- if ([_activity isAnimating]) { [_activity stopAnimating]; NSLog(@"进度结束"); }else{ [_activity startAnimating]; NSLog(@"进度开始"); }}- (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}@end
0 0
- UIActivityIndictorView的使用
- GUID使用的使用
- ${}的使用
- 的使用
- @[],@()的使用
- ->的使用
- +、-、*、/、%的使用
- &&的使用
- %:的使用
- Makefile中使用$$的使用
- Makefile中使用$$的使用
- Red5的使用--使用日志
- prefernce的使用具体使用
- 【工具使用】git 的使用
- 关于使用AsyncTaskLoader的使用
- 使用CABasicAnimation的基本使用
- 使用RocketMQ的客户端使用
- gulp的使用基本使用
- 排序算法小结
- Leetcode#5 Longest Palindromic Substring
- unity5实现数字矩阵效果实现
- 利用MAVEN打包时,如何包含更多的资源文件
- BZOJ 2667 cqoi2012 模拟工厂 贪心
- UIActivityIndictorView的使用
- 基于内容的图像检索引擎(以图搜图)
- 黑马程序员——3,JAVA基础(函数,数组相关)
- 什么是依赖注入
- 关于java Date和时区的问题
- Xcode升级后Alcatraz失效的解决方案
- [设计模式学习笔记]享元模式(FYLWEIGHT)
- JSON数据构造及解析详解
- MFC之调用DLL的问题:error C2664: “LoadLibraryW”: 不能将参数 1 从“const char *”转换为“LPCWSTR