UIActivityIndicatorView

UIActivityIndicatorView



UIActivityIndicatorView
activityIndicatorViewStyle
设置指示器的样式
UIActivityIndicatorViewStyleWhiteLarge 
UIActivityIndicatorViewStyleWhite
  (默认样式)
UIActivityIndicatorViewStyleGray 

2.hidesWhenStopped
当停止动画的时候,是否隐藏。默认为YES。
3. 实例化指示器对象,根据样式设置尺寸,不需要手动设置。
-(id)initWithActivityIndicatorStyle:(UIActivityIndicatorViewStyle)style;
4.开启动画 
- (
void)startAnimating;
5.关闭动画
- (void)stopAnimating;
6.是否在动画
- (BOOL)isAnimating;


7. UIActivityIndicatorView使用注意
7.1初始化的时候不需要设置尺寸,设置尺寸也没有效果。
7.2 必须调用
startAnimating才会显示UIActivityIndicatorView
// 初始化指示器
//
技术博客http://www.cnblogs.com/ChenYilong/ 新浪微博http://weibo.com/luohanchenyilong 
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];

© chenyilong. Powered by Postach.io


作者:
出处:http://www.cnblogs.com/ChenYilong/(点击RSS订阅)
本文版权归作者和博客园共有,欢迎转载,
但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

原文地址:https://www.cnblogs.com/ChenYilong/p/3556431.html