我有一个Master / Detail应用程序,并且在拆分视图中的MasterViewController右上角有一个按钮,它使用模态视图加载“Info”视图控制器:
单击该按钮时,将加载视图,并在iOS 5.0及更低版本中填充整个屏幕(这是我想要的行为):
- (IBAction)showAppInfo:(id)sender
{
InfoViewController *infoViewController = [[InfoViewController alloc]
initWithNibName:@"InfoViewController" bundle:nil];
infoViewController.delegate = self;
[self presentModalViewController: infoViewController animated: YES];
}
然而,当我在iOS 5.1模拟器中运行它时,它不再填充整个iPad屏幕,只填充主视图中的内容:
如何让这个InfoViewController像以前一样在iOS 5.1中填充整个屏幕?
答案 0 :(得分:0)
我假设你正在使用UIPopoverController,试试这个
InfoViewController *infoViewController = [[InfoViewController alloc]
initWithNibName:@"InfoViewController" bundle:nil];
UIPopoverController *popoverController = [[UIPopoverController alloc] initWithContentViewController:infoViewController];
popoverController.popoverContentSize = CGSizeMake(500.0, 583.0);
popoverController.delegate = self;
[popoverController presentPopoverFromRect:sender.bounds inView:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];