iOS 13.4 wkwebview 添加 UITapGestureRecognizer手勢

在13.4系統(tǒng)中,給wkwebview添加了手勢,發(fā)現(xiàn)手勢不響應(yīng)了。但是低版本都正常????
    WKWebViewConfiguration *confinguration = [[WKWebViewConfiguration alloc] init];
     confinguration.selectionGranularity = WKSelectionGranularityDynamic;
     confinguration.allowsInlineMediaPlayback = YES;
     WKPreferences *preferences = [WKPreferences new];
     preferences.javaScriptEnabled = YES;
     preferences.javaScriptCanOpenWindowsAutomatically = YES;
     confinguration.preferences = preferences;
    
    _webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) configuration:confinguration];
    _webView.navigationDelegate = self;
    [self.view addSubview:_webView];
    
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://hike-doc-online-h5.zhihuishu.com/newStuViewer.html?WOPISrc=https://file.zhihuishu.com/zhs_yufa_150820/ablecommons/demo/202005/90a0d24e5cbc4a338c156fb471ff4654.pptx"]];
    [_webView loadRequest:request];
    
    
    //添加手勢
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
    tap.delegate = self;
    [self.webView addGestureRecognizer:tap];
#pragma mark Action
- (void)tapAction:(UITapGestureRecognizer *)tap
{
    NSLog(@"@@@我被點擊了");
}

#pragma mark UIGestureRecognizerDelegate
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return YES;
}

自定義打印之后,發(fā)現(xiàn)響應(yīng)的都在 WKChildScrollView類上邊
并且手勢個數(shù)不一致

//不響應(yīng)
<UIScrollViewDelayedTouchesBeganGestureRecognizer: 0x283b9fc00; state = Possible; enabled = NO; delaysTouchesBegan = YES; view = <WKChildScrollView 0x11a061400>; target= <(action=delayed:, target=<WKChildScrollView 0x11a061400>)>>,
<UIScrollViewPanGestureRecognizer: 0x1198583c0; state = Possible; enabled = NO; delaysTouchesEnded = NO; view = <WKChildScrollView 0x11a061400>; target= <(action=handlePan:, target=<WKChildScrollView 0x11a061400>)>>,
<UIScrollViewKnobLongPressGestureRecognizer: 0x1198596a0; state = Possible; view = <WKChildScrollView 0x11a061400>; target= <(action=_handleKnobLongPressGesture:, target=<WKChildScrollView 0x11a061400>)>; numberOfTapsRequired = 0; minimumPressDuration = 0.1>,
<UIScrollViewKnobLongPressGestureRecognizer: 0x119844010; state = Possible; view = <WKChildScrollView 0x11a061400>; target= <(action=_handleKnobLongPressGesture:, target=<WKChildScrollView 0x11a061400>)>; numberOfTapsRequired = 0>,
<UIHoverGestureRecognizer: 0x119855240; state = Possible; view = <WKChildScrollView 0x11a061400>; target= <(action=_handleKnobHoverGesture:, target=<WKChildScrollView 0x11a061400>)>>,
<_UIDragAutoScrollGestureRecognizer: 0x28389cd20; state = Possible; cancelsTouchesInView = NO; delaysTouchesEnded = NO; view = <WKChildScrollView 0x11a061400>; target= <(action=_handleAutoScroll:, target=<WKChildScrollView 0x11a061400>)>>


//正常
<UIScrollViewDelayedTouchesBeganGestureRecognizer: 0x600001359e00; state = Possible; enabled = NO; delaysTouchesBegan = YES; view = <WKChildScrollView 0x7fcb1e036200>; target= <(action=delayed:, target=<WKChildScrollView 0x7fcb1e036200>)>>,
<UIScrollViewPanGestureRecognizer: 0x7fcb1c730640; state = Possible; enabled = NO; delaysTouchesEnded = NO; view = <WKChildScrollView 0x7fcb1e036200>; target= <(action=handlePan:, target=<WKChildScrollView 0x7fcb1e036200>)>>,
<UIScrollViewKnobLongPressGestureRecognizer: 0x7fcb1c730800; state = Possible; view = <WKChildScrollView 0x7fcb1e036200>; target= <(action=_handleKnobLongPressGesture:, target=<WKChildScrollView 0x7fcb1e036200>)>>,
<_UIDragAutoScrollGestureRecognizer: 0x6000016231e0; state = Possible; cancelsTouchesInView = NO; delaysTouchesEnded = NO; view = <WKChildScrollView 0x7fcb1e036200>; target= <(action=_handleAutoScroll:, target=<WKChildScrollView 0x7fcb1e036200>)>>

請教哪位大佬了解過??

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容