我正在展示一个带有 presentModalViewController:animated 的 UIViewController。
CMImportViewControlleriPhone *import = [[CMImportViewControlleriPhone alloc] initWithNibName:@"Import-iPhone" bundle:nil];
[import setModalPresentationStyle:UIModalPresentationFormSheet];
[import setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentModalViewController:import animated:YES];
[import release];
然而,顶部栏是不可见的,并且它似乎移到顶部(底部有一个空白区域)。
这是 viewDidLoad,我在其中设置了 navigationItem 上的 Close 按钮
- (void)viewDidLoad
{
[super viewDidLoad];
closeButton = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStyleBordered target:self action:@selector(closeButtonPushed:)];
[[self navigationItem] setRightBarButtonItem:closeButton];
[closeButton release];
}
谢谢