简体   繁体   中英

black screen under transition swift animation

I have the following code, when I open the new screen, the old screen turn to black screen I need that no have that black screen, just like defualt navigation that is like gray color, thanks

let transition = CATransition()
transition.duration = 1.0
transition.type = CATransitionType.moveIn
transition.subtype = CATransitionSubtype.fromTop
view.window?.layer.add(transition, forKey: nil)
viewControllerToPresent.modalPresentationStyle = .overFullScreen

video

the last part on the top

Add this transition to view.layer, not to window.layer. It fix your problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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