iPhone CATransition adds a fade to the start and end of any animation?

前端 未结 3 1672
無奈伤痛
無奈伤痛 2020-12-10 06:07

So I am just beginning recently developing some simple apps for the iphone. I will say that I am fairly sure I don\'t have a strong understanding of programming for multiple

3条回答
  •  伪装坚强ぢ
    2020-12-10 06:18

    I have never been able to find a solution to this problem, but I can offer a reasonable workaround. What's happening is it isn't fading to white, but fading to transparent, and the window background (or whatever view is behind) is white. There are a couple ways to get around this:

    1. Change the window background color. If both views you're fading between have the same solid background color, then this will look pretty good.

    2. Don't render a background in each view ("MenuView," for example), but rather have a shared background view that's under those views at all times.

    Note that this will not work in all circumstances -- grouped UITableViews, for example, are always completely opaque.

    (As I side note, I assume that you aren't build a navigation-based application, in which case all the animation should be handled automatically.)

    You also might want to consider the looking into the UIView method setAnimationTransition:forView:cache: if you haven't already as another way to transition between views (although it cannot do a sliding animation, if you are set on that).

提交回复
热议问题