UIActivityIndicatorView控件

用处: 菊花图

仅有两个方法:[aiv startAnimating]

       [aiv stopAnimating]

-(void)viewDidLoad

{

  [super viewDidLoad];

  self.aiv = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

  self.aiv.frame = CGRectMake(20,20,100,100);

  [self.view addSubView:self.aiv];

  

  self.startBtn = [[UIButton alloc]buttonWithType:UIButtonTypeRoundedRect];

  self.startBtn.frame = CGRectMake(20,100,100,50);

  [self.startBtn setTitle:@"start" forState:UIControlStateNormal];

  [self addTarget:self action:@selector(start:) forControlEvents:UIControlEventTouchUpInside];

  [self.view addSubView:self.startBtn];

 

}

-(IBAction)start:(id)sender

{

  //UIButton* btn = (UIButton*)sender;

  [self.aiv startAnimation];

}

posted @ 2014-08-07 14:41  迷茫的程序小生  阅读(113)  评论(0编辑  收藏  举报