我有一个包含两个视图的视图。其中一个视图包含两个按钮和一些文本标签。另一个,alpha设置为0.25,有一个UIActivityIndicatorView
告诉用户应用程序正在工作,他必须等到它完成。如果用户在UIActivityIndicatorView
正在旋转时触摸按钮,当UIActivityIndicatorView
停止时,应用程序会记住用户操作并对其作出响应。我如何放弃UIActivityIndicatorView
旋转时发生的用户交互?当活动指示器视图可见时,不允许用户进行交互
感谢您的阅读。
P.D .:喜欢评论于this thread,我宁愿不要使用任何模态解决方案。
编辑:
我目前使用此代码,它不工作的权利。
- (void)viewDidAppear:(BOOL)animated {
// The view appears with an UIActivityIndicatorView spinning.
[self showResults]; // The method that takes a long time to finish.
[self.activityIndicator stopAnimating];
// When the showResults method ends, the view shows the buttons to the user.
[self.activityIndicatorView setHidden:YES];
[self.menuButton setEnabled:YES];
[self.menuButton setUserInteractionEnabled:YES];
[self.playButton setEnabled:YES];
[self.playButton setUserInteractionEnabled:YES];
[self.view setUserInteractionEnabled:YES];
[self.interactionView setUserInteractionEnabled:YES];
}
这适用于我 http:// stackoverflow。com/questions/5404856/how-to-disable-touch-input-to-all-views-except-the-top-most-view – 2012-10-18 15:12:45