把UIActivityindicatorView 添加到…

http://blog.csdn.net/ssihc0/article/details/7078449


实现在代码如下,比较简单,


[cpp]  view plain copy print ?
  1. -(void)showMessage{     
  2.     alert = [[UIAlertView alloc] initWithTitle:@" " message:@"    Connecting to App Store,                  please wait" delegate:self cancelButtonTitle:nil otherButtonTitles:nil];  
  3.     UIActivityIndicatorView *progress= [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(125, 100, 30, 30)];  
  4.     progress.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;  
  5.     [alert addSubview:progress];  
  6.     [progress startAnimating];  
  7.     [alert show];  
  8.     [alert release];  
  9. }  


关闭 UIAlertView 


 

[cpp]  view plain copy print ?
  1. [alert dismissWithClickedButtonIndex:0 animated:YES];  

当然,你需要在.h文件里添加

 

[cpp]  view plain copy print ?
  1. UIAlertView *alert;  

你可能感兴趣的:(把UIActivityindicatorView 添加到…)