如何将单点触摸事件传递到UIWebView中的超级视图? [英] How to pass single touch events to super view in UIWebView?

查看:61
本文介绍了如何将单点触摸事件传递到UIWebView中的超级视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 UIWebView 显示pdf。我想处理webview上的触摸事件。
有两个条件,我的WebView应该处理两次触摸事件和手势,我想将单击/触摸事件传递给超级视图。

I am using UIWebView to display pdf. I wanna handle touch events on webview. There are two conditions, my WebView should handle double touch events and gestures, and i wanna pass single tap/touch events to super view.

任何一个都可以请告诉我如何区分 UIWebView 中的触摸事件,以及如何将特定的触摸事件传递到其超级视图?

Can any one please tell me how to differentiate the touch events in UIWebView and how to pass specific touch events to its super view?

要获取触摸事件,我将uiwebview子类化,并覆盖子类中的hitTest方法。

to get the touch events i am subclassing the uiwebview and im overriding the hitTest method in subclass.

推荐答案

如果该帖子不是回答您的问题,您应该查看本文

If that post is not answering your question, you should check out this article.

我采用了类似但略有不同的方法:我将UIView子类化,其中包含UIWebView(和其他控件),并覆盖了 hitTest: withEvent:方法。

I took a similar but slightly different approach: I subclassed a UIView, which contains a UIWebView (and other controls), and override the hitTest:withEvent: method.

这篇关于如何将单点触摸事件传递到UIWebView中的超级视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆