我在查看由UIWebView
组成的控制器时故意隐藏我的标签栏:
- (void)viewWillAppear:(BOOL)animated{
self.hidesBottomBarWhenPushed = YES;
self.tabBarController.tabBar.hidden = YES;
self.url = [NSURL URLWithString:self.urlString];
}
在我的故事板中,对于这个控制器,我将底栏设置为“无”:
我的故事板显示网络视图现在占据了底部的所有可用空间:
但是,我知道我的标签栏曾经是黑色栏:
有谁知道为什么?
答案 0 :(得分:1)
在hidesBottomBarWhenPushed
中将YES
设置为viewWillAppear
并不做任何事情。
在推送到此视图控制器之前,将hidesBottomBarWhenPushed
设置为YES
。
MyViewController *myController = [[MyViewController alloc] init];
//hide tabbar
myController.hidesBottomBarWhenPushed = YES;
//add it to stack.
[[self navigationController] pushViewController:myController animated:YES];
或者像这样的故事板