Objective c 如何在iOS 8中获得UIModalPresentationFormSheet的正确视图大小?

Objective c 如何在iOS 8中获得UIModalPresentationFormSheet的正确视图大小?,objective-c,ipad,ios8,autolayout,Objective C,Ipad,Ios8,Autolayout,我在iPad上用UIModalPresentationFormSheet演示样式展示了一个视图,用于欢迎屏幕。下面是显示视图的代码。如果之前未显示欢迎屏幕,则在我的主屏幕的viewDidLoad中调用此选项 UIStoryboard *welcomeStoryboard = [UIStoryboard storyboardWithName:[NSString stringWithFormat:@"Welcome_%@", (UI_USER_INTERFACE_IDIOM() == UIUserI

我在iPad上用UIModalPresentationFormSheet演示样式展示了一个视图,用于欢迎屏幕。下面是显示视图的代码。如果之前未显示欢迎屏幕,则在我的主屏幕的viewDidLoad中调用此选项

UIStoryboard *welcomeStoryboard = [UIStoryboard storyboardWithName:[NSString stringWithFormat:@"Welcome_%@", (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? @"iPad" : @"iPhone")] bundle:nil];
    self.welcomeViewController = [welcomeStoryboard instantiateViewControllerWithIdentifier:@"welcome"];

if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){
    self.welcomeViewController.modalPresentationStyle = UIModalPresentationFormSheet;

    if(IS_OS_8_OR_LATER){
        self.welcomeViewController.preferredContentSize = CGSizeMake(540.0f, 620.0f);
    }
}

[self presentViewController:self.welcomeViewController animated:NO completion:NULL];
在iOS 7上,视图大小适当,内容按其应有的方式流动:

在iOS 8上,模式大小是正确的,但视图仍然认为它是全屏的。当我将视图大小写入日志时,它在ViewDid出现后为768 x 1024(在iOS 7上为540 x 620)

我如何告诉模态视图与表单大小相同