标签:
设置指示器的样式
UIActivityIndicatorViewStyleWhiteLarge
UIActivityIndicatorViewStyleWhite (默认样式)
UIActivityIndicatorViewStyleGray
当停止动画的时候,是否隐藏。默认为YES。
-(id)initWithActivityIndicatorStyle:(UIActivityIndicatorViewStyle)style;
- (void)startAnimating;
- (void)stopAnimating;
- (BOOL)isAnimating;
// 初始化指示器
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
// 设置指示器位置
indicator.center = CGPointMake(self.view.frame.size.width * 0.5, self.view.frame.size.height * 0.5);
// 开启动画,必须调用,否则无法显示
[indicator startAnimating];
[self.view addSubview:indicator];
标签:
原文地址:http://www.cnblogs.com/Jc-Strive/p/5089180.html