有很多答案,但似乎对于iOS 9(特别是9.2)似乎都无法正常/完美地工作。请有人帮忙。这是一个简单的场景,其中:

1)情节提要剧集连接到单个toBePresentedModally视图控制器,我选择了UIModalPresentationOverCurrentContext以及当情节提要的样式不起作用时切换并尝试使用UIModalPresentationCurrentContext。

2)我要么在幸福的一秒钟后得到黑色背景(它可以正常工作一秒钟),要么当我尝试通过分配toBePresentedModally View Controller类通过代码呈现它时,我得到一个空白控制器。

任何帮助,将不胜感激!

最佳答案

这就是我在代码中所做的

let viewController = UIStoryboard.loadViewController("Identifier")
viewController.providesPresentationContextTransitionStyle = true
viewController.definesPresentationContext = true
viewController.modalPresentationStyle = .OverCurrentContext
self.presentViewController(viewController)


而且工作正常。

关于ios - 在iOS 9中显示透明模态视图,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35268288/

10-14 23:27