以编程方式禁用Alertview

问题描述:

我想在不带按钮的AlertView中显示活动指示符,我想在活动指示器停止动画时将其禁用。以编程方式禁用Alertview

在此先感谢

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title" message:@"Message" delegate:self cancelButtonTitle:nil otherButtonTitles:nil]; 
UIActivityIndicatorView *progress= [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(125, 50, 30, 30)]; 
progress.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge; 
[alert addSubview:progress]; 
[progress startAnimating]; 
[alert show]; 
[progress release]; 

然后解除警报视图和微调:(你需要做的警报视图中的成员)

[alert dismissWithClickedButtonIndex:0 animated:YES]; 
[alert release]; 

只需拨打dismissWithClickedButtonIndex:animated:方法UIAlertView中

[alertView dismissWithClickedButtonIndex:0 animated:YES]; 
+0

它工作,谢谢 –

只需拨打:

[theAlertViewInstance dismissWithClickedButtonIndex: 0 animated:YES]; 

这应该做,你需要什么。