如何在iPad的splitview的弹出窗口(左侧窗格)中添加导航项?这是导航的邮箱/收件箱/草稿部分位于iPad内置电子邮件应用程序中的位置。
答案 0 :(得分:3)
将UISplitViewController
的“主”窗格设为UINavigationController
,然后只需按UIViewController
s上的navigationItem
。
以下是一个示例设置:
UIViewController *masterController = [[MyCustomMasterController alloc] init…];
[[masterController navigationItem] setTitle:@"Root"];
UINavigationController *navController =
[[UINavigationController alloc] initWithRootController:masterController];
UIViewController *detailController [[MyCustomDetailController alloc] init…];
UISplitViewController *splitView = [[UISplitViewController alloc] init];
[splitView setViewControllers:[NSArray arrayWithObjects:navController,
detailController,
nil]];
然后是:
UIViewController *subController = [[MyCustomSubController alloc] init…];
[[masterController navigationController] pushViewController:subController
animated:YES];
将新的UIViewController
推送到UINavigationController
的堆栈会导致MyCustomMasterController
视图显示标题为“Root”的后退按钮。