UINavigationController 与 PresentModalViewController

发布于 2024-08-08 17:14:57 字数 377 浏览 3 评论 0原文

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

I have a menu screen that implements UINavigationController and on top of that screen, using presentModalViewController, I place another screen on which I want to have another UINavigationController. I have tried to implement another navigation controller to handle the new screen but I either get a navbar 1/8th the way down the screen and it crashes or nothing at all. I have tried [[UINavigationController alloc] initWithRootViewController:navigationConroller] with no success as well. I'm just using pushViewController to try and place the next nib on the stack which doesn't work. What am I doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痴者 2024-08-15 17:14:57

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

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

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

[self presentModalViewController:navController animated:YES];

Although there are a lot of people saying on forums that Apple doesn't allow this I have got it to work. What you have to do is:

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

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

[self presentModalViewController:navController animated:YES];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文