带有presentModalViewController的UINavigationController

Rud*_*ger 2 iphone uinavigationcontroller presentmodalviewcontroller

我有一个菜单屏幕,实现UINavigationController并在屏幕上,使用presentModalViewController,我放置另一个屏幕,我想要另一个UINavigationController.我试图实现另一个导航控制器来处理新的屏幕,但我要么在屏幕下方的1/8处获得一个导航栏,它会崩溃或什么都没有.我也尝试[[UINavigationController alloc] initWithRootViewController:navigationConroller]过没有成功.我只是pushViewController试图将下一个nib放在堆栈上,但这不起作用.我究竟做错了什么?

Rud*_*ger 10

虽然有很多人在论坛上说苹果公司不允许这样做,但我已经开始工作了.你要做的是:

Map *mapScreen = [[[Map alloc] init] autorelease];
mapScreen.delegate = self;

UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:mapScreen] autorelease];

[self presentModalViewController:navController animated:YES];
Run Code Online (Sandbox Code Playgroud)

  • 很简单.Apple应该在他们的文档中添加这些代码段. (2认同)