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

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

问题描述

我有一个带有标签栏控制器的应用程序,每个视图都包含一个导航控制器.我的 MainWindow 如下所示: 图片在这里 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: Image here http://www.freeimagehosting.net/image.php?7bc867a594.png

一切正常,但在将详细信息视图推送到导航控制器时,我注意到了一个问题.在属于标签栏控制器的 tableviewcontroller 的 didSelectRowAtIndexPath 中(图像中称为最新的那个)我正在这样做:

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 有自己的标签栏,因为它需要显示不同的东西.问题是,当我将 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;

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

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