简体   繁体   English

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

[英]Is it possible to disable background fade of CATransition?

Given the following: 鉴于以下内容:

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 transitions from the bottom to the top just like a modal transition/segue. viewController从底部到顶部转换,就像模态转换/ segue一样。 However, as the view controller makes its way up, the background begins to fade to black (to cover the old view). 但是,随着视图控制器向上移动,背景开始淡化为黑色(覆盖旧视图)。 Is there any way to disable that fade from occurring? 有没有办法禁止发生淡入淡出?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM