iphone:如何在显示一些 UIView 时阻止触摸
我目前的情况是这样的 ->我正在展示一个带有按钮的视图控制器。当我单击该按钮时,会打开一个小视图。现在我想要什么。当显示该视图时,我不希望用户触摸该视图下方(即使在导航栏的后退按钮中)。 UIAlertView 做的事情是一样的。我如何用我的自定义视图实现这一目标?
请建议。
my current scenario is this -> i am showing a view controller that has a button. when i click that button a small view opens. now what i want. when that view is shown i don't want user to touch below that ( even in navigation bar's back button ). the same thing which UIAlertView does. how i can achieve that thing with my custom view ??
Please suggest.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用不同的 UIView 覆盖当前视图,该视图将接受触摸并停止触摸。
这里有一些代码覆盖
UIView
,它是黑色的(并且稍微透明)以阻止触摸。更新
要禁用后退按钮,请尝试使用以下命令。
You could cover the current view with a different
UIView
which would take the touches and stop them.Here's some code to overlay a
UIView
which is black (and slightly transparent) to block touches.UPDATE
To disable the back button, try using the following.