ios 让 UIView 通过触摸事件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6662468/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Make UIView pass through touch events?
提问by Morrowless
Is there a way to make a UIView unresponsive AND pass through all touch events? Basically I just want to display graphics on top of other UIViews without blocking touch events.
有没有办法让 UIView 无响应并通过所有触摸事件?基本上我只想在其他 UIViews 之上显示图形而不阻止触摸事件。
回答by
The event sent to your view will go through the responder chain, if it doesn't implement any event handling method.
发送到您的视图的事件将通过响应者链,如果它没有实现任何事件处理方法。
You could also set the userInteractionEnabled
property to NO
for that view.
您还可以将userInteractionEnabled
属性设置NO
为该视图。