我正在为 iPad 创建一个应用程序,我创建了 3 个带有导航栏的视图,但我想不在第一个视图中启动我的应用程序,而是在第二个视图中启动我的应用程序,我该怎么办?
您可以设置UI导航控制器 http://developer.apple.com/library/ios/#documentation/uikit/reference/UINavigationController_Class/Reference/Reference.html#//apple_ref/doc/c_ref/UINavigationController带有初始导航堆栈setViewControllers:animated:
.
// in application:didFinishLaunchingWithOptions:
self.navigationController = [[UINavigationController new] autorelease];
UIViewController *first = [[MyFirstViewController new] autorelease];
UIViewController *second = [[MySecondViewController new] autorelease];
NSArray *controllers = [NSArray arrayWithObjects:first, second, nil];
[navigationController setViewControllers:controllers animated:NO];
...
[window addSubview:navigationController.view];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)