标签:des style class blog code java
- (void)viewDidLoad { [super viewDidLoad]; //创建UIActivityIndicatorView并设置样式:WhiteLarge为37 * 37,Gray和White为20 * 20 _activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; //设置对象的位置,大小是固定不变的 _activityIndicatorView.frame = CGRectMake(160, 230, 0, 0); //设置活动指示器的颜色 _activityIndicatorView.color = [UIColor grayColor]; //hidesWhenStopped默认为YES,会隐藏活动指示器。要改为NO //_activityIndicatorView.hidesWhenStopped = NO; //添加到当前视图 [self.view addSubview:_activityIndicatorView]; //开始动画 [_activityIndicatorView startAnimating]; //5秒之后停止动画 [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(stop) userInfo:nil repeats:NO]; } - (void)stop{ [_activityIndicatorView stopAnimating]; }
UIActivityIndicatorView的使用方法(旋转动画),布布扣,bubuko.com
UIActivityIndicatorView的使用方法(旋转动画)
标签:des style class blog code java
原文地址:http://www.cnblogs.com/hw140430/p/3784697.html