[英]UIViewController - UIModalPresentationCurrentContext not rotating presentingViewController
我曾经提出一个UIViewController
从另一个UIViewController
与演讲风格UIModalPresentationCurrentContext
。 但它不会让我转动presentingviewcontroller
(该UIViewController
所呈现新UIViewController
)
self.modalPresentationStyle = UIModalPresentationCurrentContext;
NewViewController *newViewController = [[NewViewController alloc] initWithNibName:@"NewViewController" Bundle: nil];
[self presentViewController:newViewController animated:YES completion:nil];
当我旋转设备时,它将旋转newViewController
和statusbar
而不presentingViewController
newViewController
PS:这里presentingViewController
是self
。
使用UIModalPresentationFormSheet
代替UIModalPresentationCurrentContext
尝试这个
self.modalPresentationStyle = UIModelPresentationFormSheet; NewViewController *newViewController = [[NewViewController alloc] initWithNibName:@"NewViewController" Bundle: nil]; [self presentViewController:newViewController animated:YES completion:nil];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.