Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone NavigationController与TabBarController一起使用时不显示_Iphone_Objective C_Uinavigationcontroller_Ios4_Uitabbarcontroller - Fatal编程技术网

Iphone NavigationController与TabBarController一起使用时不显示

Iphone NavigationController与TabBarController一起使用时不显示,iphone,objective-c,uinavigationcontroller,ios4,uitabbarcontroller,Iphone,Objective C,Uinavigationcontroller,Ios4,Uitabbarcontroller,在我的iphone应用程序中,我有一个导航控制器和一个tabBar控制器 TabBarController有三个选项卡。在第二个和第三个选项卡中,NavigationController被添加到ViewController中 问题: 在第三个选项卡视图中,控制器显示导航栏,但在第二个选项卡视图中,控制器不显示导航栏 我尝试和检查过的事情: 1我检查了IB中的所有连接是否正确完成 2我检查了视图的框架大小。它不与导航栏重叠 3我还尝试使用self.navigationController.navi

在我的iphone应用程序中,我有一个导航控制器和一个tabBar控制器

TabBarController有三个选项卡。在第二个和第三个选项卡中,NavigationController被添加到ViewController中

问题:

在第三个选项卡视图中,控制器显示导航栏,但在第二个选项卡视图中,控制器不显示导航栏

我尝试和检查过的事情:

1我检查了IB中的所有连接是否正确完成

2我检查了视图的框架大小。它不与导航栏重叠

3我还尝试使用self.navigationController.navigationBar.hidden=NO

但它仍然没有在第二个选项卡中显示导航栏

我该怎么办

请建议

请帮忙


谢谢

如果不看你的代码,我们就做不了什么

假设您的TabBarController已在Interface Builder中正确连接,您将需要类似以下内容:

UIViewController *firstView = [[UIViewController alloc] init];
UIViewController *secondView = [[UIViewController alloc] init];
UIViewController *thirdView = [[UIViewController alloc] init];

UINavigationController *firstNav = [[UINavigationController alloc] initWithRootViewController:secondView];
UINavigationController *secondNav = [[UINavigationController alloc] initWithRootViewController:thirdView];

self.tabBarController.viewControllers = [NSArray arrayWithObjects:firstView, firstNav, secondNav, nil];

当然,之后发布所有视图。

嗯,这也是我面临的问题

如果你看一下你的IB文件,你会发现你可以对它做一些调整。
我一有时间就会发布详细信息。

Oops!!!我犯了一个很大的错误。我没有选中NavigationController检查器中显示导航栏的复选框。希望这对某人有所帮助。

这已经完成,但问题仍然是一样的。感谢您的回复。请检查您是否勾选了IB中Inspector中的show navigationBar复选框