繁体   English   中英

UIViewController-UIModalPresentationCurrentContext不旋转presentingViewController

[英]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];

当我旋转设备时,它将旋转newViewControllerstatusbar而不presentingViewController newViewController

PS:这里presentingViewControllerself

在此处输入图片说明

使用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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM