web禁用侧滑手势

This commit is contained in:
fengshuo
2022-10-31 15:56:46 +08:00
parent 3a8967eb18
commit bd6ddf6f44

View File

@@ -91,6 +91,7 @@ NSString * const kCloseWebView = @"closeWebView";
NSString * const kJumpAppointPage = @"jumpAppointPage";
NSString * const kJSOpenRoom = @"openRoom";
NSString * const kJSOpenRoomForGiftId = @"openRoomForGiftId";
NSString * const kProhibitRightSlip = @"prohibitRightSlip";
@implementation XPWebViewController
@@ -99,6 +100,11 @@ NSString * const kJSOpenRoomForGiftId = @"openRoomForGiftId";
[self initView];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
}
- (void)initView {
if (self.navigationController.viewControllers.count > 1){
UIBarButtonItem *leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"common_nav_back"] style:UIBarButtonItemStylePlain target:self action:@selector(backButtonClick)];
@@ -286,7 +292,9 @@ NSString * const kJSOpenRoomForGiftId = @"openRoomForGiftId";
if (uid.length > 0) {
[XPRoomViewController openRoom:uid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
}
} else if([message.name isEqualToString:kJSOpenRoomForGiftId]) {
} else if ([message.name isEqualToString:kProhibitRightSlip]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
} else if([message.name isEqualToString:kJSOpenRoomForGiftId]) {
NSLog(@"%@", message.body);
NSDictionary *bodyDict;
if ([message.body isKindOfClass:[NSDictionary class]]) {
@@ -612,6 +620,8 @@ NSString * const kJSOpenRoomForGiftId = @"openRoomForGiftId";
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenRoom];
//
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenRoomForGiftId];
///
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kProhibitRightSlip];
}
return _userContentController;
}