与 TabBarController 一起使用时,NavigationController 不显示
在我的 iPhone 应用程序中,我有一个导航控制器和一个 tabBar 控制器。
TabBarController 具有三个选项卡。在第二个和第三个选项卡中,导航控制器被添加到视图控制器中。
问题:
在第三个选项卡视图控制器中显示导航栏,但在第二个选项卡视图控制器中不显示导航栏。
我尝试和检查过的事情:
1)我检查了 IB 中的所有连接是否正确完成
2)我检查了视图框架的大小。它不与导航栏重叠。
3)我也尝试使用 self.navigationController.navigationBar.hidden = NO;
但它仍然没有在第二个选项卡中显示导航栏。
我应该怎么办?
请大家
帮忙
推荐一下谢谢!!
In my iphone app, i have a navigation Controller and a tabBar Controller.
The TabBarController has three tabs. In the second and third Tab the NavigationController are added to the viewControllers.
Problem :
In third tab viewController shows the NavigationBar but the in second tab viewController doesnot display navigationBar.
Things I have tried and checked:
1) I checked that all the connections in IB are done properly
2) I checked the size of frame for the view. It doesnot overlap the navigationBar.
3) I also tried using self.navigationController.navigationBar.hidden = NO;
But still it does not show the navigationBar in the second tab.
What should I do?
Please Suggest
Please Help
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果不查看您的代码,我们就无能为力。
假设您的
TabBarController
在 Interface Builder 中正确连接,您将需要类似这样的东西:当然,之后要释放每个视图。
We can't do much without looking at your code.
Assuming your
TabBarController
is properly connected in Interface Builder, you'll need something similar to this:Of course, have every view released afterwards.
嗯,这也是我遇到的问题。
如果您查看 IB 文件,您会发现可以进行一些调整并实现它。
我一有时间就会发布详细信息。
Hmmm thats a problem i faced too.
If you look at your IB file ,you'll see that you can do a bit of tweaking and acheive it.
i'll post details as soon as i get time.
哎呀!!!我犯了一个大错误。我没有在 NavigationController 的检查器中选中“显示导航栏”复选框。希望这对某人有帮助。
Oops!!! a big mistake on my part.I did not check the checkbox for "show navigation bar" in inspector for NavigationController. Hope this helps someone.