我正在尝试实现UIModalTransitionStyle.flipHorizontal,它可以工作,但它显示的只是一个黑色视图。下面是我的代码:
@IBAction func loadNextView(_ sender:UIButton){
let nextVC = NextViewController()
nextVC.modalTransitionStyle = UIModalTransitionStyle.flipHorizontal
self.present(nextVC, animated: true, completion: nil)
}你们谁知道它为什么是黑色的吗?或者如何显示正确的视图?
我将非常感谢你的帮助
发布于 2018-06-26 04:31:17
你需要像这样加载VC:nextID is it's id in storyboard
let nextVC = self.storyboard?.instantiateViewController(withIdentifier: "nextID") as! NextViewController发布于 2018-06-26 15:36:25
尝试将显示的视图控制器的modalPresentationStyle设置为overCurrentContext:
nextVC.modalPresentationStyle = .overCurrentContexthttps://stackoverflow.com/questions/51031309
复制相似问题