项目场景:
Cordova config.xml 添加AllowBackForwardNavigationGestures属性后
同时开启了 左右滑动
问题描述:
但是左滑返回会引起下个页面各种异常
Cordova没看到有禁止左滑的属性 那只能从源码上解决了 接下来 也可加群获取源码978165670
解决方案:
找到CordovaLib->Private>Plugins>CDVWebViewEngine文件夹 在该文件夹下创建文件 HDWebView.h//
// HDWebView.h
// CordovaLib
//
// Created by xx
//
#ifndef _HDWebView_h
#define _HDWebView_h
#import <WebKit/WebKit.h>
@interface HDWebView : WKWebView
@end
#endif /* _HDWebView_h */
再创建文件 HDWebView.m
//
// HDWebView.m
// CordovaLib
//
// Created by huagui on 2021/4/7.
//
#import "HDWebView.h"
@implementation HDWebView
- (void) addGestureRecognizer:(UIGestureRecogniz