UIViewController - UIModalPresentationCurrentContext不旋转presentsViewController

Raf*_*eek 8 iphone objective-c uiviewcontroller ipad ios

我曾经以演示风格呈现UIViewController另一个.但它不允许我旋转(新呈现)UIViewControllerUIModalPresentationCurrentContextpresentingviewcontrollerUIViewControllerUIViewController

self.modalPresentationStyle = UIModalPresentationCurrentContext;
NewViewController *newViewController = [[NewViewController alloc] initWithNibName:@"NewViewController" Bundle: nil];
[self presentViewController:newViewController animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)

当我旋转设备将旋转newViewControllerstatusbar,但不presentingViewController

PS:这presentingViewControllerself.

在此输入图像描述

ios*_*ist 0

使用UIModalPresentationFormSheet而不是UIModalPresentationCurrentContext

尝试这个

self.modalPresentationStyle = UIModelPresentationFormSheet; NewViewController *newViewController = [[NewViewController alloc] initWithNibName:@"NewViewController" Bundle: nil]; [self presentViewController:newViewController animated:YES completion:nil];