本文介绍了iOS - 通过视图转发所有触摸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个视图覆盖在许多其他视图之上.我只使用 overaly 来检测屏幕上的一些触摸次数,但除此之外,我不希望视图停止下面其他视图的行为,即滚动视图等.如何转发所有触摸这个叠加视图?它是 UIView 的子类.
I have a view overlayed on top of many other views. I am only using the overaly to detect some number of touches on the screen, but other than that I don't want the view to stop the behavior of other views underneath, which are scrollviews, etc. How can I forward all the touches through this overlay view? It is a subclass of UIView.
推荐答案
我只需要禁用用户交互!
Disabling user interaction was all I needed!
目标-C:
myWebView.userInteractionEnabled = NO;
斯威夫特:
myWebView.isUserInteractionEnabled = false
这篇关于iOS - 通过视图转发所有触摸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!