美文网首页
二级三级页面隐藏系统tabbar

二级三级页面隐藏系统tabbar

作者: MrCSA | 来源:发表于2017-09-12 10:47 被阅读0次

    1、单个处理

    YourViewController *yourVC = [YourViewController new];

    yourVC.hidesBottomBarWhenPushed = YES;

    [self.navigationController pushViewController:yourVC animated:YES];

    2.统一在基类里面处理

    新建一个类BaseNavigationController继承UINavigationController,然后重写 -(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated这个方法。所有的push事件都走此方法。

    @interface BaseNavigationController : UINavigationController

    @end

    -(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{

    if (self.viewControllers.count>0) {

    viewController.hidesBottomBarWhenPushed = YES;

    }

    [super pushViewController:viewController animated:animated];

    }

    相关文章

      网友评论

          本文标题:二级三级页面隐藏系统tabbar

          本文链接:https://www.haomeiwen.com/subject/zrfcsxtx.html