Borzh
Borzh

Reputation: 5205

UIView.transition shows parent view with dark background (Swift)

While flipping, the parent view fades into black (from white) to the middle of the animation, then fades into white again... Why?

My code:

    if !cardFrontView.isHidden {
        let transitionOptions: UIViewAnimationOptions = [.transitionFlipFromRight, .showHideTransitionViews]
        UIView.transition(from: cardFrontView, to: cardBackView, duration: 1.0, options: transitionOptions, completion: nil)
    }
    else {
        let transitionOptions: UIViewAnimationOptions = [.transitionFlipFromLeft, .showHideTransitionViews]
        UIView.transition(from: cardBackView, to: cardFrontView, duration: 1.0, options: transitionOptions, completion: nil)
    }

I also tried UIView.transition(with: but I have another problem there: round corners are disappearing.

Struggling all day with this... I mean that's all the code.

1 2 3 4

Upvotes: 0

Views: 810

Answers (1)

iOS Geek
iOS Geek

Reputation: 4855

Try setting BaseView Color to UIColor.clear instaed of UIColor.white

Upvotes: 1

Related Questions