Iphone UIPopOverview控制器内的模态UINavigationController

Iphone UIPopOverview控制器内的模态UINavigationController,iphone,objective-c,uinavigationcontroller,uipopovercontroller,Iphone,Objective C,Uinavigationcontroller,Uipopovercontroller,这就是我的情况: 我有一个UINavigationViewController,其中包含UIPopoverViewController中的UITableViewController堆栈。这就是它现在的样子: 然后,其中一个按钮具有此操作: MyViewController *moveViewcontroller = [[MyViewController alloc] init]; moveViewcontroller.contentSizeForViewInPopover = self.cont

这就是我的情况:

我有一个UINavigationViewController,其中包含UIPopoverViewController中的UITableViewController堆栈。这就是它现在的样子:

然后,其中一个按钮具有此操作:

MyViewController *moveViewcontroller = [[MyViewController alloc] init];
moveViewcontroller.contentSizeForViewInPopover = self.contentSizeForViewInPopover;

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:moveViewcontroller];
navController.toolbarHidden = NO;
navController.navigationBarHidden = NO;
navController.contentSizeForViewInPopover = self.navigationController.contentSizeForViewInPopover;
navController.modalPresentationStyle = UIModalPresentationCurrentContext;//to show it inside the popover

[self.navigationController presentModalViewController:navController animated:YES];
[navController release];
[moveViewcontroller release];
它显示了导航控制器,但与第一张图片中的导航控制器不同,它没有嵌入到“UIPopoverController”中。这就是我得到的:

不是很好,和以前的界面不一致 有没有办法让我的模态导航控制器嵌入到UIPopoverController中


基本上,当将电子邮件从一个文件夹移动到另一个文件夹时,我想在iPhone中实现一个类似于Mail.app的界面,但在popover中。

您需要指定以模式方式显示的UIViewController的显示样式。 我使用以下代码执行此操作:

MyViewController* mvc = 
[[MyViewController alloc]
 initWithNibName:@"MyViewController"
 bundle:nil];
mvc.modalPresentationStyle = UIModalPresentationFormSheet;
mvc.contentSizeForViewInPopover = CGSizeMake(320.0f, 210.0f);
[self.navigationController pushViewController:mvc animated:YES];

关键的一行是处理modalPresentationStyle的一行-它强制ModalView控制器出现在UIPopoverController内部

Hummm,。。。我的错。我想问题是我的问题。我不仅对视图控制器的presentationStyle感兴趣,而且对它的工具栏和导航栏应该有的chrome也感兴趣。看来,改装的导航控制器周围不会有漂亮的海军蓝厚铬