8

我曾经用演示风格呈现UIViewController来自另一个的。但它不允许我旋转(呈现新的)UIViewControllerUIModalPresentationCurrentContextpresentingviewcontrollerUIViewControllerUIViewController

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

当我旋转设备时,它会旋转newViewControllerstatusbar但不会presentingViewController

PS:这里presentingViewControllerself

在此处输入图像描述

4

1 回答 1

0

使用UIModalPresentationFormSheet代替UIModalPresentationCurrentContext

尝试这个

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

于 2014-03-11T20:57:44.280 回答