开发者

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.

However, when I add the UIViewControllers using

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

it only shows the first one.

开发者_C百科

I have tried simply setting the title property of each of my view controllers then adding them, I have tried doing

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

And also tried doing the previous operation in the initWithNibNamed: bundle: method.

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? Make sure you have it properly connected when using IB.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜