IOS 之 UIActivityIndicatorView
2016-01-10 10:15
531 查看
1. activityIndicatorViewStyle(样式)
UIActivityIndicatorViewStyleWhiteLargeUIActivityIndicatorViewStyleWhite (默认样式)
UIActivityIndicatorViewStyleGray
2.hidesWhenStopped
当停止动画的时候,是否隐藏。默认为YES
3.开启动画
- (void)startAnimating;
4.关闭动画
- (void)stopAnimating;
5.实例代码
#import "ViewController.h"@interface ViewController ()
@property (weak,
nonatomic) IBOutlet
UIActivityIndicatorView *acttuvutyIndicator;
@property (weak,
nonatomic) IBOutlet
UIImageView *imageView;
@end
@implementation ViewController
- (void)viewDidLoad {
[super
viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
//
设置图片是隐藏状态
self.imageView.hidden =
YES;
//
停止转动后隐藏
self.activityIndicator.hidesWhenStopped =
YES;
//
开始转动
[self.activityIndicator
startAnimating];
//
添加计时器, 两秒后执行stop方法
[NSTimer
scheduledTimerWithTimeInterval:2
target:self
selector:@selector(stop)
userInfo:NULL
repeats:NO];
}
//停止转动
- (void) stop{
//
停止转动
[self.acttuvutyIndicator
stopAnimating];
//
设置图片为显示状态
self.imageView.hidden =
NO;
}
- (void)didReceiveMemoryWarning {
[super
didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
相关文章推荐
- (转)Java中StringBuilder的清空方法比较
- UIButton详细的属性介绍
- SpriteKit 1-SKScene
- UITableview性能优化总结
- UITableView的使用(熟练使用)
- 利用简单的参数传递来实现单条查询的easyui-datagrid
- Leetcode: Range Sum Query 2D - Immutable
- UIView的一些知识
- [WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platf...
- 如何处理UIVIew addsubview 不显示subview
- iOS开发之UIAlertController新版的使用方法
- 补充UIAlertView的一些知识,包括UIAlertViewStyleLoginAndPasswordInput和代理方法
- UITextField只能输入一位字符串
- UITextField和UITextView限制字数(包括中文)
- hdu 2560 buildings
- 【优先队列】:poj2442,Sequence
- Druid数据库连接池两种简单使用方式
- Floodligh Web UI显示的host比实际多且不会被清除的原因及解决方法
- DRUID连接池的简单使用
- Android View重绘和更新: invalidate和requestLayout