UINavigationController 与 presentModalViewController

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

问题描述

我有一个实现 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?

推荐答案

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

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

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

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type(异常:不应为错误类型创建SimpleTypeImpl)
Android IllegalArgumentException: The tag for fragment_XXX is invalid. Received: layout-sw600dp/fragment_XXX_0(Android IlLegalArgumentException:Fragment_XXX的标签无效。收到:Layout-sw600dp/Fragment_XXX_0)
iOS convert audio sample rate from 16 kHz to 8 kHz(IOS将音频采样率从16 kHz转换为8 kHz)
Enforcing an audio sampling rate in iOS(在iOS中强制音频采样率)
HTTPS request using volley(使用 volley 的 HTTPS 请求)