在UINavigationController中显示UITableViewController

时间:2010-11-04 23:17:47

标签: iphone-sdk-3.0 uinavigationcontroller uitabbarcontroller

我需要创建一个UITabBarController,它将在一个选项卡中有一个可以导航的UITableViewController。所以,我在Interface Builder中创建了UITabBarController。我也实现了我的UITableViewController的子类。

我从Apple文档中无法理解的是我应该如何在UITabBarController中插入我的UITableViewController实现,以便它也可以导航?我应该向UITabBarController添加UITableViewController还是UINavigationController?我如何将UITableViewController链接到UINavigationController?

谢谢!

2 个答案:

答案 0 :(得分:0)

层次结构如下:

  • 的UITabBarController
    • 的UINavigationController
      • 的UITableViewController

截图:

table-nav-tab

要在您使用的代码中引用UINavigationController:self.navigationController

答案 1 :(得分:0)

self.window.rootViewController = self.viewController;

行,添加

UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
相关问题