【发布时间】:2011-03-10 12:10:40
【问题描述】:
我希望将 2 个导航控制器附加到一个标签栏项目。
基本上,这个想法是在一个标签项上有 2 个视图,并且应该有一个导航栏来推送和弹出屏幕。 (与 iPad 中的设置应用程序相同)。
已编辑======
看起来左侧有一个 View 有自己的导航控制器,而右侧有另一个 View 有自己的导航控制器(或其他一些 UI)来实现 Push Pop 的东西。
我知道如何将 1 个导航控制器附加到一个标签栏项目。
针对 ModalView 问题编辑:- 通过实施 conmulligan 代码,一切正常。但是,如果我尝试在 lansdscape 模式下显示一些 ModalViewController,并且当我尝试关闭此 ModalView 时,FirstViewController 导航栏将变为纵向(连同其视图),而 SecondViewController NavigationBar 仍为横向(应该如此)。这只发生在设备而不是模拟器中。
下面是我展示 ModalViewController 的代码。
ModalTableViewController *modalTableViewController = [[ModalTableViewController alloc]initWithNibName:@"ModalTableViewController" bundle:[NSBundle mainBundle]];
UINavigationController *localNavigationViewController = [[UINavigationController alloc] initWithRootViewController:modalTableViewController];
localNavigationViewController.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:localNavigationViewController animated:YES];
[modalTableViewController release];
[localNavigationViewController release];
为了关闭 ModalViewCntroller,我这样做如下:-
[self dismissModalViewControllerAnimated:YES];
等待您的回复。
【问题讨论】: