在 UIView 中捕获手势
这看起来很简单,但我被困住了。
我有一个可以响应某些手势的视图控制器。 我添加了一个类似于“抬头”菜单的子视图;它覆盖了整个屏幕,背景颜色是半透明的,因此下面其他视图的微弱图像可以显示出来。
我不希望“抬头”子视图让手势传递到父视图控制器。也就是说,我不希望 VC 对手势敏感,直到“Heads up”子视图被消除。
现在,即使显示“平视”子视图,VC 也会对手势起作用。
提前致谢。
This seems simple enough, but I'm stuck.
I have a View Controller that respondes to some gestures.
I add a subview that is like a "heads up" menu; it covers the entire screen, the background color is semi-transparent so faint images of other views below show through.
I don't want the "heads up" subview to let gestures pass to the parent viewcontroller. That is, I don't want the VC to be gesture-sensitive until the "Heads up" subview is dismissed.
Now, the VC acts on gestures even when the "heads up" subview is displayed.
Thanx in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果有人有兴趣...
我最终构建了一个自定义视图,在需要时将其用作“手势陷阱”。
不是很漂亮,但工作正常。
If anyone is interested...
I ended up building a custom view that I uses as a "gesture trap" where needed.
Not very pretty, but works fine.