删除标签栏
在我的 iPhone 应用程序的大部分内容中,我想用导航控制器和标签栏来显示内容。 但对于少数屏幕,我需要更多空间,所以我想删除标签栏。
我发现在调用不需要标签栏的控制器之前我可以将其设置为隐藏它,
CardImageViewController *cardImage = [[CardImageViewController alloc]
initWithNibName:@"CardImageViewController" bundle:nil];
cardImage.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:cardImage animated:YES];
[cardImage release];
问题是现在我无法让它再次显示。如果我设置
xxx.hidesBottomBarWhenPushed = NO;
下一个控制器,我仍然看不到选项卡栏,
如何让它显示。
In most part of my iPhone application I want to show things with navigation controller and tab bar.
But for few screens I need more space so I want to remove the tab bar.
I found before calling the controller that doesn’t need the tab bar I can set to hide it,
CardImageViewController *cardImage = [[CardImageViewController alloc]
initWithNibName:@"CardImageViewController" bundle:nil];
cardImage.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:cardImage animated:YES];
[cardImage release];
The problem is now I can’t get it to display again. If I set
xxx.hidesBottomBarWhenPushed = NO;
for the next controller still I can’t see the tab bar
How do I get it to display.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该栏将保持隐藏状态,直到您从导航堆栈中弹出隐藏的控制器。
参考:http://developer.apple .com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html
解决此问题的一种方法是为那些要隐藏选项卡栏的控制器提供模式视图
The bar will remain hidden until you pop that controller that you hide off the navigation stack.
Refer to: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html
One way to solve this is to present modal view for those controllers that you want to hide the tab bar
您希望在哪个视图中隐藏选项卡栏,请使用
cardImage.hidesBottomBarWhenPushed = YES;
在推送之前
,现在在同一视图的 viewWillDisAppear 中,您需要
cardImage.hidesBottomBarWhenPushed = NO;
In which view you want tab Bar hide use
cardImage.hidesBottomBarWhenPushed = YES;
this before push
and now in viewWillDisAppear of same view you need
cardImage.hidesBottomBarWhenPushed = NO;