移除tabBar 重影

 

-(void)viewWillLayoutSubviews{ide

    

    [super viewWillLayoutSubviews];字體

    

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

        

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

            

            [child removeFromSuperview];it

            

        }io

        

    }class

    

}im

 

@interface BaseNavigationController ()call

//<UINavigationControllerDelegate>d3

 

@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];

}

相關文章
相關標籤/搜索