pushViewcontroller时如何透明背景? 就像...全屏模式视图 (以编程方式,不使用故事板,不使用现有模态)
第一视图控制器>按钮操作>
let transition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionPush //kCATransitionFade
transition.subtype = kCATransitionFade
self.navigationController?.view.layer.add(transition, forKey: nil)
let testVC = SecondViewController()
if let existVC = self.navigationController {
existVC.pushViewController(testVC, animated: false)
}
第二个视图控制器
super.viewDidLoad()
self.view.backgroundColor = UIColor.clear
结果是......黑色背景。 如何透明背景?