如果在push跳转时需要隐藏tabBar,设置self.hidesBottomBarWhenPushed=YES;
例如:
NextViewController *next=[[NextViewController alloc]init];
[self.navigationController pushViewController:next animated:YES];
self.hidesBottomBarWhenPushed=NO;
一般情况这么设置就行了,返回tabbar时会自动显示出来tabbar,但是在我的项目中,动态创建控制器并获取当前控制器来进行push时,返回后tabbar没有显示出来!
这么解决:
- 在push后设置
self.hidesBottomBarWhenPushed=NO;
- 这样back回来的时候,tabBar会恢复正常显示。
self.hidesBottomBarWhenPushed=YES;
NextViewController *next=[[NextViewController alloc]init];
[self.navigationController pushViewController:next animated:YES];
self.hidesBottomBarWhenPushed=NO;
网友评论