使用的UIView动画 [英] Using UIView Animated
本文介绍了使用的UIView动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用present的UIView动画时在屏幕负载元素此code:
I'm using for present UIView animations when load elements in the screen this code:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationDelegate:self];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];
[self.view addSubview:myView];
[UIView commitAnimations];
和工作正常。视图是presented动画。
And works fine. The view is presented with animation.
但问题是,当我想删除这个观点动画。我使用的是:
But the problem is when I want to remove this view animated. I'm using:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationDelegate:self];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:myview cache:YES];
[myview removeFromSuperview];
[UIView commitAnimations];
但使用的方法removeFromSuperview时,认为只有消失,不用动画。如果我删除此方法执行动画,但当时并未消失。
But when the method removeFromSuperview is used, the view only disappears without animation. If I remove this method the animation is executed but then didn't disappears.
任何帮助吗?
推荐答案
这似乎是的从动画的SuperView 的UIView的删除
This appears to be a duplicate of Remove UIVIew from SuperView with Animation.
请参阅接受的答案有一个解决方案。
See the accepted answer there for a solution.
这篇关于使用的UIView动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文