UIActivityIndi​​catorView无法使用io5

时间:2012-01-28 18:27:23

标签: ios4 uiactivityindicatorview ios5

在加载信息时,我的应用中有UIActivityIndi​​catorView。所以IN模拟器ios 4.3它工作正常但在ios5.0中我看不到它。怎么了?如果您需要代码,请告诉我。谢谢

1 个答案:

答案 0 :(得分:1)

-(void)Viewdidload
{
 UIActivityIndicatorView *activity = [[UIActivityIndicatorView alloc]  initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];

        [activity setFrame:CGRectMake(0, 0, 20, 20)];

        [self.view addSubview:activity];


}  
-(void)PressLoginBtn
{
  [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;

[activity startAnimating];

// call another controller

}

- (void)viewWillDisappear:(BOOL)animated 
{
  [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
[activity stopAnimating];
}