修复了webView 侧滑返回的时候隐藏的导航栏重新显示的问题

This commit is contained in:
fengshuo
2022-12-07 16:02:06 +08:00
parent 8f527ec5f5
commit a215585469
3 changed files with 12 additions and 2 deletions

View File

@@ -81,6 +81,7 @@
_cycleScrollView.delegate = self;
_cycleScrollView.showPageControl = NO;
_cycleScrollView.autoScrollTimeInterval = 5.0;
_cycleScrollView.tag = 9999;
}
return _cycleScrollView;
}

View File

@@ -228,8 +228,8 @@
#pragma mark - JXPagerMainTableViewGestureDelegate
- (BOOL)mainTableViewGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
///1000scrollView 1001collectionView
if (otherGestureRecognizer.view.tag == 1000 || otherGestureRecognizer.view == self.headerView || otherGestureRecognizer.view.tag == 1001) {
///1000scrollView 1001collectionView 9999
if (otherGestureRecognizer.view.tag == 1000 || otherGestureRecognizer.view == self.headerView || otherGestureRecognizer.view.tag == 1001 || otherGestureRecognizer.view.tag == 9999) {
return NO;
}
return [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]];

View File

@@ -74,6 +74,8 @@ typedef NS_ENUM(NSUInteger, RightNavigationPushType){
@property (nonatomic, strong) WKUserContentController *userContentController;
///
@property (nonatomic,copy) NSDictionary *shareDic;
///
@property (nonatomic,assign) BOOL isHiddenNav;
@end
NSString * const kJSOpenPurse = @"openPurse";
@@ -98,6 +100,7 @@ NSString * const kProhibitRightSlip = @"prohibitRightSlip";
- (void)viewDidLoad {
[super viewDidLoad];
self.isHiddenNav = NO;
[self initView];
}
@@ -106,6 +109,11 @@ NSString * const kProhibitRightSlip = @"prohibitRightSlip";
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self.navigationController setNavigationBarHidden:self.isHiddenNav animated:animated];
}
- (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)];
@@ -265,6 +273,7 @@ NSString * const kProhibitRightSlip = @"prohibitRightSlip";
self.InitShowNavBlock(YES);
return;
}
self.isHiddenNav = YES;
if (self.navigationController) {
[self.navigationController setNavigationBarHidden:YES];
}