gpt4 book ai didi

ios - UIModalTransitionStylePartialCurl 不适用于 iOS 8

转载 作者:行者123 更新时间:2023-11-29 12:31:19 26 4
gpt4 key购买 nike

我的代码完全适用于 iOS7 及以下版本。但是对于 xcode6 和 iOS8 UIModalTransitionStylePartialCurl 是行不通的。当 View 出现时,页面 curl 会在几分之一秒内消失。

MyViewController* opts = [[MyViewController alloc] initWithView:someView];
opts.modalPresentationStyle = UIModalPresentationFullScreen;
opts.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[self presentViewController:opts animated:YES completion:nil];

[编辑] - 我发现如果构建完成 xCode5.1 并在 iOS8 上运行,这将按预期工作。 xCode6 和 iOS8 构建有问题吗?

最佳答案

从评论中的第一个链接复制(我在那篇文章中的解决方案)。

我遇到了同样的问题并应用了此修复程序,它在 iOS 8 和 Xcode 6 上对我有效。

    [_mapToolbarController setModalTransitionStyle:UIModalTransitionStylePartialCurl];
[self presentViewController:_mapToolbarController animated:YES completion:^{
[_mapToolbarController.view.superview addSubview:self.view];
}];

显然,_mapToolbarController 将是您要呈现的 Controller 。要了解您为什么需要它,请在完成处理程序的行中添加一个断点。执行动画,您将在完成处理程序中看到 curl 动画刚刚完成并且一切都很好。由于某些我无法解释的原因,在 iOS 8 中,您需要告诉 iOS 框架“保留” curl View 并确保它不会被丢弃。完成处理程序中的代码试图将即将消失的 curl View “保留”在屏幕上。请注意,在此上下文中,self.view 是被 curl 的 View 。

关于ios - UIModalTransitionStylePartialCurl 不适用于 iOS 8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27596762/

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