酷店

KDPMainNavViewController.m 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // KDPMainNavViewController.m
  3. // KuDianProject
  4. //
  5. // Created by admin on 2019/7/12.
  6. // Copyright © 2019 KDP. All rights reserved.
  7. //
  8. #import "KDPMainNavViewController.h"
  9. @interface KDPMainNavViewController ()
  10. @end
  11. @implementation KDPMainNavViewController
  12. - (void)viewDidLoad {
  13. [super viewDidLoad];
  14. // Do any additional setup after loading the view.
  15. self.navigationBar.shadowImage= [UIImage new];
  16. self.navigationController.navigationBar.shadowImage= [UIImage new];
  17. }
  18. - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
  19. // 解决push到子控制器时tabbar不隐藏的问题
  20. if (self.viewControllers.count > 0) {
  21. viewController.hidesBottomBarWhenPushed = YES;
  22. }
  23. [super pushViewController:viewController animated:animated];
  24. [self setNavigationBarHidden:NO animated:YES];
  25. }
  26. - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
  27. // 当返回到根视图控制器时,就不需要滑动返回了,需要禁用,不然会出现程序卡顿现象
  28. if (self.viewControllers.count == 1) {
  29. return NO;
  30. }
  31. return YES;
  32. }
  33. @end