开发者

Custom XIB Transitions?

开发者 https://www.devze.com 2023-03-23 05:24 出处:网络
In my app I want to add a custom transition when switching views. Since its a game, I want to go to the Play view by fading to black then even开发者_如何学编程tually fading into the Play.xib. So how w

In my app I want to add a custom transition when switching views. Since its a game, I want to go to the Play view by fading to black then even开发者_如何学编程tually fading into the Play.xib. So how would I do that? Also are there any cool transitions that would work going (for a game) to go to other views so my app looks a bit better? I just need some assistance in this.

Thanks!


To fade in or out, put a view with a black background behind your view. Then use Core Animation to animate the alpha property of your view from 1.0 (fully opaque) to 0.0 (completely tranparent). Remove the old view and replace it with the new one (with it's alpha set to 0.0). Then again use Core Animation to animate the change of the new view's alpha from 0.0 to 1.0.

0

精彩评论

暂无评论...
验证码 换一张
取 消