【IT专家】在滚动ios时停止UIWebView Tap Gesture 您所在的位置:网站首页 webview禁止滑动 【IT专家】在滚动ios时停止UIWebView Tap Gesture

【IT专家】在滚动ios时停止UIWebView Tap Gesture

#【IT专家】在滚动ios时停止UIWebView Tap Gesture| 来源: 网络整理| 查看: 265

本文由我司收集整编,推荐下载,如有疑问,请与我司联系

 

在滚动

 

ios 

时停止

 

UIWebView Tap Gesture 

在滚动

 

ios 

时停止

 

UIWebView 

Tap 

Gesture[

]Stop 

UIWebView 

Tap 

Gesture 

while 

its scrolling ios I 

am using 

tap gesture 

to detect 

tap on UIWebView and it works 

correct with following code: 

 

我正在使用轻击手势来检测

 

UIWebView 

上的点击,它使用以下代码正常工作:

 

 

 

UITapGestureRecognizer 

*targetGesture 

[[UITapGestureRecognizer 

alloc] 

initWithTarget:self 

action:@selector(handleTap:)];targetGesture.numberOfTapsRequired 

= 1;targetGesture.delegate = self;[_webView1 addGestureRecognizer:targetGesture]; 

And 

i am handling it with UIGestureRecognizerDelegate methods as follows:- 

 

我正在使用

 

UIGestureRecognizerDelegate 

方法处理它,如下所示:

 

 

 

(void)handleTap:(UITapGestureRecognizer 

*)sender(BOOL)gestureRecognizer:(UIGestureRecognizer 

*)gestureRecognizer 

shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer 

*)otherGestureRecognizer(BOOL)gestureRecognizer:(UIGestureRecognizer 

*)gestureRecognizer 

shouldReceiveTouch:(UITouch 

*)touch 

Now 

want 

to 

disable 

tap 

gesture while UIWebView is scrolling. 

 

现在我想在

 

UIWebView 

滚动时禁用轻击手势。

 

 

 

Same as 

“NYTimes”

 ios app doing. 

 

“NYTimes”ios

 app 

一样。

 

 

 

 

I finally resolved it by using following method of UIWebView: 

 

我终于通过使用

 

UIWebView 

的以下方法解决了它:

 

 

 

(BOOL)webView:(UIWebView*)webView 

shouldStartLoadWithRequest:(NSURLRequest*)request 

navigationType:(UIWebViewNavigationType)navigationType 

if(navigationType 

== 

UIWebViewNavigationTypeLinkClicked) 

NSString 

*URL 

[[request 

URL]



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有