UIActivityIndicatorView
Posted i旅程
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了UIActivityIndicatorView相关的知识,希望对你有一定的参考价值。
//声明对象
@property (nonatomic,strong) UIActivityIndicatorView *activityindicator;
self.activityindicator = [[UIActivityIndicatorViewalloc] initWithFrame:CGRectMake((self.view.frame.size.width-100)/2.0, self.view.frame.size.height/2.0, 100, 100)];
self.activityindicator.backgroundColor = [UIColor colorWithWhite:0.5 alpha:0.5];
//设置风格
self.activityindicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
//一个布尔值,用于控制在动画停止时是否隐藏接收者
self.activityindicator.hidesWhenStopped = YES;
//启动
[self.activityindicator startAnimating];
//暂停
//[self.activityindicator stopAnimating];
//状态
//self.activityindicator.isAnimating;
//设置活动指标的颜色
self.activityindicator.color = [UIColor blueColor];
[self.view addSubview:self.activityindicator];
//设置风格
self.activityindicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
//一个布尔值,用于控制在动画停止时是否隐藏接收者
self.activityindicator.hidesWhenStopped = YES;
//启动
[self.activityindicator startAnimating];
//暂停
//[self.activityindicator stopAnimating];
//状态
//self.activityindicator.isAnimating;
//设置活动指标的颜色
self.activityindicator.color = [UIColor blueColor];
[self.view addSubview:self.activityindicator];
以上是关于UIActivityIndicatorView的主要内容,如果未能解决你的问题,请参考以下文章