美文网首页
设置hidesBottomBarWhenPushed返回后tab

设置hidesBottomBarWhenPushed返回后tab

作者: XueYongWei | 来源:发表于2017-02-10 15:42 被阅读1110次

如果在push跳转时需要隐藏tabBar,设置self.hidesBottomBarWhenPushed=YES;
例如:

    NextViewController *next=[[NextViewController alloc]init];
    [self.navigationController pushViewController:next animated:YES];
    self.hidesBottomBarWhenPushed=NO;

一般情况这么设置就行了,返回tabbar时会自动显示出来tabbar,但是在我的项目中,动态创建控制器并获取当前控制器来进行push时,返回后tabbar没有显示出来!
这么解决:

  1. 在push后设置self.hidesBottomBarWhenPushed=NO;
  2. 这样back回来的时候,tabBar会恢复正常显示。
    self.hidesBottomBarWhenPushed=YES;
    NextViewController *next=[[NextViewController alloc]init];
    [self.navigationController pushViewController:next animated:YES];
    self.hidesBottomBarWhenPushed=NO;

相关文章

网友评论

      本文标题:设置hidesBottomBarWhenPushed返回后tab

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