zoukankan      html  css  js  c++  java
  • 移除tabBar 重影

     

    -(void)viewWillLayoutSubviews{

        

        [super viewWillLayoutSubviews];

        

        for (UIView *child in self.tabBar.subviews) {

            

            if ([child isKindOfClass:NSClassFromString(@"UITabBarButton")]) {

                

                [child removeFromSuperview];

                

            }

            

        }

        

    }

     

    @interface BaseNavigationController ()

    //<UINavigationControllerDelegate>

     

    @end

     

    @implementation BaseNavigationController

     

    - (void)viewDidLoad {

        [super viewDidLoad];

        self.navigationBar.translucent = NO;

        self.automaticallyAdjustsScrollViewInsets = NO;

        self.navigationBar.barTintColor =  JRGBCOLOR(245, 246, 247);     //设置导航栏字体样式

        self.navigationBar.tintColor = JRGB(0xa4a4a4);

        [self.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17.0f],NSForegroundColorAttributeName:[UIColor blackColor]}];

    //    self.delegate = self;

    }

    - (void)pushViewController:(UIViewController *)viewController

                      animated:(BOOL)animated

    {

        if (self.viewControllers.count > 0) {

            viewController.hidesBottomBarWhenPushed = YES;

        }

        [super pushViewController:viewController animated:animated];

    }

    //- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated

    //{

    //    // 删除系统自带的tabBarButton

    //    for (UIView *tabBar in self.tabBarController.tabBar.subviews) {

    //        if ([tabBar isKindOfClass:NSClassFromString(@"UITabBarButton")]) {

    //            [tabBar removeFromSuperview];

    //        }

    //    }

    //}

    - (void)didReceiveMemoryWarning {

        [super didReceiveMemoryWarning];

    }

  • 相关阅读:
    【leetcode】腾讯精选练习 50 题(更新中)
    将博客搬至CSDN
    【笔记】linux基础(更新中)
    【寒窑赋】写在百篇博客之后
    【笔记】Vim
    【笔记】Git(更新中)
    【笔记】Java基础教程学习(更新中)
    【面试题】Java核心技术三十六讲(更新中)
    【leetcode】shell和sql题目思路汇总(更新中)
    【笔记】MySQL基础及高级特性(更新中)
  • 原文地址:https://www.cnblogs.com/wq-gril/p/7211876.html
Copyright © 2011-2022 走看看