_activityView = [[UIActivityIndicatorView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
_activityView.center = self.view.center;
_activityView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
_activityView.hidesWhenStopped = YES;
_activityView.color = [UIColor greenColor];
[self.view addSubview:_activityView];
在需要开始的地方调用:
[_activityView startAnimating];
在需要结束的地方调用:
[_activityView stopAnimating];