1.初始化
UIActivityIndicatorView *progress = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
[self.view addSubview:progress];
progress.frame = CGRectMake(160-15, 200-30, 30, 30);
[progress sizeToFit];
2.开始忙碌
[progress performSelectorOnMainThread:@selector(startAnimating) withObject:nil waitUntilDone:NO];
3.结束忙碌
[progress stopAnimating];
本文介绍了如何在iOS应用中使用UIActivityIndicatorView实现加载指示器。包括初始化、开始及停止加载指示器的过程。通过简单的三步操作,开发者可以轻松地为应用添加加载提示效果。
2万+

被折叠的 条评论
为什么被折叠?



