How to fade between views, transitioning through black?
What is the easiest way of fade from one view to another, but through a black screen? In other words, first the current view fades to black, and then the new view fades in from black.
I tried to do this by using the CATransition object using kCATransitionFade as the transition type so that I first remove the current subview and add a black subview and then in the animationDidStop method I call it again, but this time I remove the black subview and add the new view.
This works in the simulator like a charm. However, on the iPhone there's a really annoying flickering during the transition. I have no idea what is causing it.
If I transition (using kCATransitionFade) from the old view to the new view, it works ok, but if I do it like I described above, the annoying flickering happens. The only difference between these two situations is that in the latter case I'm launching a new transition from the animationDidStop method (while in the former case I'm not). I have no idea if this is what is causing the problem (or why it would be).
|