是否可以禁用CATransition的背景淡入淡出?

时间:2017-06-10 03:37:21

标签: ios swift uinavigationcontroller pushviewcontroller catransition

鉴于以下内容:

let transition = CATransition()
    transition.duration = 0.5
    transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionDefault)
    transition.type = kCATransitionMoveIn
    transition.subtype = kCATransitionFromTop
    navigationController.view.layer.add(transition, forKey: kCATransition)
    navigationController.pushViewController(viewController, animated: false)

viewController从底部过渡到顶部,就像模态过渡/ segue一样。但是,随着视图控制器向上移动,背景开始淡化为黑色(覆盖旧视图)。有没有办法禁止发生淡入淡出?

1 个答案:

答案 0 :(得分:0)

回答我自己的问题:你只需更改UIWindow的颜色