本文介绍了是否可以在ModalPopup中创建UINavigationController?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我有一个modalViewController,我弹出使用

Hi I have a modalViewController that I am popping up using

[self presentModalViewController:myController animated:YES];

我有一个事件发生在myController,我想导致另一个控制器被推到导航堆栈在myController的顶部(它再次被模态地呈现)。我如何做到这一点?

I have an event occurring within myController which I would like to result in another controller being pushed onto the navigation stack ON TOP OF myController (which again has been presented modally). How can I do this?

我已经在myController内尝试过以下操作:

I have tried the following from within myController:

UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:self];
  NewController* n = [[NewController alloc] init];
  [navController pushViewController:n animated:YES];
  [n release];

这不起作用....

推荐答案

首先创建您的第二个modalViewController

First create your second modalViewController

NewController* new = [[NewController alloc] init];

然后像这样创建navigaitonController

then create navigaitonController like this

UINavigationController* navigationController = [[UINavigationController alloc] initWithRootViewController: new];
navigationController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

然后将您的navigationController显示为modalview控制器

then present your navigationController as modalview controller

[self presentModalViewController:navigationController animated:YES];
[navigationController release];

在这里。希望它有帮助。

Here you go. Hope it helps.

这篇关于是否可以在ModalPopup中创建UINavigationController?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 15:43