简体   繁体   English

iOS SDK UITabBarController仅显示两个UIViewControllers之一

[英]iOS SDK UITabBarController only shows one of two UIViewControllers

I am trying to make an iPhone application with two tabs: One for the game, and one for the instructions. 我试图制作一个带有两个选项卡的iPhone应用程序:一个用于游戏,一个用于说明。

However, when I add the UIViewControllers using 但是,当我使用添加UIViewControllers时

[_tabBarController setViewControllers:[NSArray arrayWithObjects:self.viewController, self.viewController2, nil] animated:NO] 

it only shows the first one. 它只显示第一个。

I have tried simply setting the title property of each of my view controllers then adding them, I have tried doing 我试过简单地设置每个视图控制器的title属性,然后添加它们,我试着做

[_viewController setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"something" image:nil tag:0]]

And also tried doing the previous operation in the initWithNibNamed: bundle: method. 并且还尝试在initWithNibNamed: bundle:方法中执行之前的操作。
However, nothing I do seems to allow me to show more than the one tab on the screen. 但是,我所做的一切似乎都无法允许我在屏幕上显示多个标签。
Any help is greatly appreciated. 任何帮助是极大的赞赏。
Thanks, 谢谢,
Michael. 迈克尔

Is viewController2 nil and it just didn't load? 是viewController2为零,只是没有加载? Make sure you have it properly connected when using IB. 使用IB时,请确保已正确连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在UITabBarController中的两个UIViewControllers之间传递信息 - How to pass information between two UIViewControllers in a in a UITabBarController UITabBarController具有与UIViewControllers关联的6个实际选项卡,但是具有5个选项卡按钮和一个仅以编程方式调用的选项卡 - UITabBarController with 6 real tabs associated with UIViewControllers, but with 5 tab buttons and one tab called only programically 如何在iOS 8中关闭两个UIViewControllers? - How to dismiss two UIViewControllers in iOS 8? 带有一个 Tab 栏控制器的几个 UIViewControllers - iOS - Few UIViewControllers with one Tab bar controller - iOS 在UITabBarController中的UIViewController之间共享UIView - Sharing a UIView between UIViewControllers in a UITabBarController 两个UIViewControllers在一个屏幕上没有SplitViewController - Two UIViewControllers on one screen without SplitViewController 在UITabBarController / UIViewControllers之间移动值 - Move a value between UITabBarController /UIViewControllers 呈现两个UIViewControllers,一个用于风景,一个用于肖像? - Presenting Two UIViewControllers , One for landscape and one for portrait is possible? UITabBarController的子UIViewControllers重叠状态栏 - Children UIViewControllers of UITabBarController overlapping Status Bar UIViewControllers-TabBarApplication-iPhone SDK - UIViewControllers - TabBarApplication - iPhone SDK
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM