gpt4 book ai didi

iphone - UIViewController - UIModalPresentationCurrentContext 不旋转 presentingViewController

转载 作者:可可西里 更新时间:2023-11-01 03:21:21 25 4
gpt4 key购买 nike

我曾经使用呈现样式 UIModalPresentationCurrentContext 从另一个 UIViewController 呈现一个 UIViewController。但它不允许我旋转 presentingviewcontroller(呈现新 UIViewControllerUIViewController)

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

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

PS:这里的presentingViewControllerself

enter image description here

最佳答案

使用 UIModalPresentationFormSheet 而不是 UIModalPresentationCurrentContext

试试这个

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

关于iphone - UIViewController - UIModalPresentationCurrentContext 不旋转 presentingViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19448494/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com