123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- //
- // KDPMainNavViewController.m
- // KuDianProject
- //
- // Created by admin on 2019/7/12.
- // Copyright © 2019 KDP. All rights reserved.
- //
- #import "KDPMainNavViewController.h"
- @interface KDPMainNavViewController ()
- @end
- @implementation KDPMainNavViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- self.navigationBar.shadowImage= [UIImage new];
- self.navigationController.navigationBar.shadowImage= [UIImage new];
- }
- - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
-
- // 解决push到子控制器时tabbar不隐藏的问题
- if (self.viewControllers.count > 0) {
- viewController.hidesBottomBarWhenPushed = YES;
-
- }
-
- [super pushViewController:viewController animated:animated];
- [self setNavigationBarHidden:NO animated:YES];
- }
- - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
-
- // 当返回到根视图控制器时,就不需要滑动返回了,需要禁用,不然会出现程序卡顿现象
- if (self.viewControllers.count == 1) {
- return NO;
- }
-
- return YES;
- }
- @end
|