简体   繁体   English

阻止iPad UIAlertView在外部单击时关闭?

[英]Prevent iPad UIAlertView from dismissing when clicked outside of it?

Is it possible to prevent the default nature of the iPad not iPhone UIAlertView so that when a person clicks outside the bounds of the UIAlertView it will not dismiss? 是否可以防止iPad的默认属性而不是iPhone的UIAlertView的默认属性,以便当一个人在UIAlertView的边界之外单击时不会消失? Currently you can click anywhere on the screen and it will just dismiss but I can not have this feature because the user has to click something inside the alert view otherwise my application will not run right and it will crash! 当前,您可以在屏幕上的任何位置单击,它只会关闭,但我不能使用此功能,因为用户必须在警报视图中单击某些内容,否则我的应用程序将无法正常运行,并且将崩溃!

So is there any way to change this default behavior? 那么有什么办法可以改变这种默认行为呢?

Thanks! 谢谢!

What you can do is to show a view that blocks the screen and then call the UIAlertView. 您可以做的是显示一个阻塞屏幕的视图,然后调用UIAlertView。

So now you have your view, the blocking view and the UIAlertView in front. 现在,您可以在前面看到视图,阻止视图和UIAlertView。

When you clic the UIAlertView option you also dismiss the blockingView. 当您选择UIAlertView选项时,还可以关闭blockingView。 This blocking View is like a loading View but without a spinner. 此阻塞视图就像一个加载视图,但没有微调器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM