2

我有一个实现的菜单屏幕,UINavigationController在该屏幕的顶部,使用presentModalViewController,我放置了另一个屏幕,我希望在该屏幕上拥有另一个UINavigationController. 我试图实现另一个导航控制器来处理新屏幕,但我要么在屏幕下方的 1/8 处得到一个导航栏,要么崩溃,要么什么也没有。我也试过[[UINavigationController alloc] initWithRootViewController:navigationConroller]没有成功。我只是pushViewController用来尝试将下一个笔尖放在不起作用的堆栈上。我究竟做错了什么?

4

1 回答 1

10

尽管有很多人在论坛上说苹果不允许这样做,但我已经让它工作了。你要做的是:

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

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

[self presentModalViewController:navController animated:YES];
于 2009-10-26T07:31:40.277 回答