在navigationController中按下控制器时如何隐藏父标签栏 [英] How to hide parent tabbar when pushing controller in navigationController

查看:132
本文介绍了在navigationController中按下控制器时如何隐藏父标签栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带标签栏控制器的应用程序,每个视图都包含一个导航控制器。我的主窗口如下所示:替代文字http://www.freeimagehosting.net/image.php?7bc867a594.png

I have an application with a tab bar controller and each view contains a navigation controller. My MainWindow looks as follows: alt text http://www.freeimagehosting.net/image.php?7bc867a594.png

一切正常,但我注意到将细节视图推送到导航控制器时出现问题。在forSelectRowAtIndexPath中,对于属于选项卡栏控制器(图像中名为Latest)的tableviewcontroller,我这样做:

Everything works fine as it is but I noticed a problem when pushing a details view to the navigation controller. In the didSelectRowAtIndexPath for a tableviewcontroller that belongs to the tab bar controller (the one called Latest in the image) I am doing this:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
ArticleViewController *articleController = [[ArticleViewController alloc] initWithNibName:@"ArticleView" bundle:nil];

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

[articleController release];
articleController = nil;

}

ArticleViewController有自己的tabbar因为它需要显示不同的东西。问题是,当我将ArticleViewController推入navigationController时,我会在视图底部看到两个标签栏。有什么方法可以解决这个问题吗?

The ArticleViewController has its own tabbar because it needs to display different things. The problem is that when I push the ArticleViewController into the navigationController I see both tabbars at the bottom of the view. Is there any way I can solve this problem?

提前致谢

推荐答案

花了好几个小时并在这里发帖提问我发现这个问题的解决方案是在实例化ArticleController之后添加以下行。

After spending hours and posting a question here I found that the solution to this problem is adding the following line after the instantiation of ArticleController.

articleController.hidesBottomBarWhenPushed = YES;

这篇关于在navigationController中按下控制器时如何隐藏父标签栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆