Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何解决与webView及其子视图的手势冲突?;_Ios_Swift_Webview_Uigesturerecognizer - Fatal编程技术网

Ios 如何解决与webView及其子视图的手势冲突?;

Ios 如何解决与webView及其子视图的手势冲突?;,ios,swift,webview,uigesturerecognizer,Ios,Swift,Webview,Uigesturerecognizer,我想在我的webview中添加双击手势,但并没有截获自己的点击回调,我有一个子视图来响应双击手势,但点击回调的webview将无效 { webMaskView = UIView() webVie w.addSubview(webMaskView) webMaskView.snp.makeConstraints { (make) in make.left.right.top.bottom.equalTo(webV) } let doubleT

我想在我的webview中添加双击手势,但并没有截获自己的点击回调,我有一个子视图来响应双击手势,但点击回调的webview将无效

{
    webMaskView = UIView()
    webVie w.addSubview(webMaskView)
    webMaskView.snp.makeConstraints { (make) in
        make.left.right.top.bottom.equalTo(webV)
    }
    let doubleTap = UITapGestureRecognizer(target: self, action: #selector(webViewTwoTaped(_ :)))
    doubleTap.delegate = self
    doubleTap.numberOfTapsRequired = 2
    webMaskView.addGestureRecognizer(doubleTap)
    webMaskView.isUserInteractionEnabled = true
    webMaskView.backgroundColor = UIColor.blue.withAlphaComponent(0.1)
}

func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
    return true
}

func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
    return true
}

override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
    return true
}

双击手势无需添加子视图,可以直接在Webview或WKWebView上添加双击手势。

双击手势无需添加子视图,您可以直接在Webview或WKWebView上添加双击手势。

直接将双击识别器添加到Web视图本身如何?是否使用Webkit framework中的UIWebView或WKWebView?是否直接将双击识别器添加到Web视图本身?是否使用Webkit framework中的UIWebView或WKWebView?