iOS - UI - UIActivityIndicatorView

时间:2023-07-16 10:13:44
1、UIActivityIndicatorView

HUD 指示器

UIActivityIndicatorView * indicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

//暂停时隐藏

indicatorView.hidesWhenStopped = YES;

indicatorView.center = self.view.center;

//设置风火轮的颜色

indicatorView.color = [UIColor redColor];

- (IBAction)startActity:(id)sender {

//开始动画

[self.indicatorView startAnimating];

}

- (IBAction)stopActity:(id)sender {

//结束动画

[self.indicatorView stopAnimating];

}