ios8 UIModalTransitionStylePartialCurl无法正常工作 [英] ios8 UIModalTransitionStylePartialCurl doesn't work properly
问题描述
在ios 8下使用presentViewController modalTransitionStyle = UIModalTransitionStylePartialCurl消失所有页面。
我希望它像ios 7一样工作。
Under ios 8 using presentViewController modalTransitionStyle = UIModalTransitionStylePartialCurl disappear all page. I want it to work like ios 7.
推荐答案
我有同样的问题,我应用了这个修复,它在iOS 8和Xcode 6上为我工作。
I had the same issue and I applied this fix, it worked for me on iOS 8 and Xcode 6.
[_mapToolbarController setModalTransitionStyle:UIModalTransitionStylePartialCurl];
[self presentViewController:_mapToolbarController animated:YES completion:^{
[_mapToolbarController.view.superview addSubview:self.view];
}];
显然,_mapToolbarController将是您想要呈现的控制器。要了解为什么需要这个,请在完成处理程序的行中添加断点。做动画,你会在完成处理程序中看到卷曲动画刚刚完成,一切都很好。由于某种原因我无法解释,在iOS 8中你需要告诉iOS框架保持卷曲的视图,并确保它不被丢弃。完成处理程序中的代码尝试将即将褪色的卷曲视图保留到屏幕上。请注意,在此上下文中,self.view是正在卷曲的视图。
Obviously, _mapToolbarController will be the controller that you want to present. To see why you'd need this, add a breakpoint at the line in the completion handler. Do the animation, and you'll see in the completion handler that the curling animation had just finished and everything was perfectly fine. For some reason that I can't explain, in iOS 8 you'll need to tell the iOS framework to "keep" the curled view and make sure it doesn't get thrown away. The code in the completion handler tries to "keep" the soon-to-be-faded curled view onto the screen. Note that in this context, self.view is the view that is being curled.
这篇关于ios8 UIModalTransitionStylePartialCurl无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!