开发者

Display splashview on start and hide it after 2 seconds with curl animation

开发者 https://www.devze.com 2023-03-11 18:06 出处:网络
I\'m displaying a splashview on start of my application and after 2 seconds i move it out to the right. Th开发者_如何学Cis works fine :)

I'm displaying a splashview on start of my application and after 2 seconds i move it out to the right. Th开发者_如何学Cis works fine :)

But now I(or better somebody else) want a curlup animation to hide the splashview. And I don't get it to work :(

I added a containerView with two imageViews. One with the splashImage and one with an transparent image. And now I want to switch them...

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.containerView cache:YES];

[self.splashView removeFromSuperview];
[self.containerView addSubview:self.splashViewTrans];    

[UIView commitAnimations];

With this code it shows nothing. No transition and no splashImage...

Does anyone solve this and can give me a tip?

Thanks, Stefan


Try commitAnimations before removing the splashView—the splashView is disappearing before the animation occurs. setAnimationTransition:forView:cache: only creates an animation; to display it you have to commit it.

0

精彩评论

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