presentModalViewController不显示工具栏?

时间:2010-11-27 12:29:08

标签: ios view uitoolbar

我有一个viewcontroller我试图显示为UIModalPresentationFormSheet,但它没有显示它的UIToolbar。如何在其上显示工具栏?

ConnectionEditViewController * connectionEditViewController = [[ConnectionEditViewController alloc] initWithNibName:@"ConnectionEditViewController" bundle: nil];
connectionEditViewController.modalInPopover = YES;
connectionEditViewController.modalPresentationStyle = UIModalPresentationFormSheet;
connectionEditViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

[self presentModalViewController: connectionEditViewController animated: YES];

1 个答案:

答案 0 :(得分:5)

创建一个UINavigationController实例,将rootViewController设置为您的connectionEditViewController,然后配置UINavigationController的模态属性并显示它。

如果这是在iPad上,它应该弹出视图,导航栏作为顶部的灰色工具栏。 配置connectionEditViewController的navigationItem以配置导航栏。