0

我正在尝试实施UIModalTransitionStyle.flipHorizontal并且它有效,但它只显示一个黑色视图。这是我的代码:

@IBAction func loadNextView(_ sender:UIButton){

    let nextVC = NextViewController()
    nextVC.modalTransitionStyle = UIModalTransitionStyle.flipHorizontal
    self.present(nextVC, animated: true, completion: nil)
}

你们中的任何人都知道为什么它显示黑色视图吗?或者如何显示正确的视图?

我会非常感谢你的帮助

4

2 回答 2

1

您需要像这样加载 VC [ nextID is it's id in storyboard ]

let nextVC  = self.storyboard?.instantiateViewController(withIdentifier: "nextID") as! NextViewController
于 2018-06-25T20:31:17.160 回答
0

尝试将呈现的视图控制器的 modalPresentationStyle 设置为 overCurrentContext:

nextVC.modalPresentationStyle = .overCurrentContext
于 2018-06-26T07:36:25.380 回答