作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的代码完全适用于 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/
我是一名优秀的程序员,十分优秀!