UIViewController - UIModalPresentationCurrentContext不旋转presentsViewController

时间:2013-10-18 11:22:57

标签: iphone ios objective-c ipad uiviewcontroller

我曾经使用演示风格UIViewController来呈现来自另一个UIViewController的{​​{1}}。但它不允许我轮换UIModalPresentationCurrentContext(提出新presentingviewcontroller的{​​{1}})

UIViewController

当我旋转设备时,它会旋转UIViewControllerself.modalPresentationStyle = UIModalPresentationCurrentContext; NewViewController *newViewController = [[NewViewController alloc] initWithNibName:@"NewViewController" Bundle: nil]; [self presentViewController:newViewController animated:YES completion:nil]; 但不会newViewController

PS:此处statusbarpresentingViewController

enter image description here

1 个答案:

答案 0 :(得分:0)

使用UIModalPresentationFormSheet代替UIModalPresentationCurrentContext

试试这个

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