uinavigationcontroller

uinavigationcontroller

本文介绍了带有presentModalViewController的UINavigationController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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?

推荐答案

虽然有很多人在论坛上说Apple不允许这样做但我有得到它的工作。你要做的是:

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];

这篇关于带有presentModalViewController的UINavigationController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 04:55