我尝试通过将视图的背景颜色更改为clearcolor 和删除FadeIn / Out来删除两个视图之间的淡化动画
self.navigationController!.view.layer.removeAnimationForKey("FadeIn")
self.navigationController!.view.layer.removeAnimationForKey("FadeOut")
根据以下答案和,
Anyway to remove fade when using CATransition between 2 views?
仍然会获得淡入淡出动画。以下是我的代码。
let transition: CATransition = CATransition()
transition.duration = 1
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionDefault)
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromRight
self.navigationController!.view.layer.removeAnimationForKey("FadeIn")
self.navigationController!.view.layer.removeAnimationForKey("FadeOut")
self.navigationController!.view.layer.addAnimation(transition, forKey: kCATransition)
self.navigationController!.popViewControllerAnimated(false)