【发布时间】:2011-08-10 13:04:41
【问题描述】:
代码:
UIView *superView = [self.view superview];
CATransition *animation = [CATransition animation];
animation.duration = 0.5f;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.fillMode = kCAFillModeForwards;
animation.type = kCATransitionFade;
animation.subtype = kCATransitionFromTop;
[root.view removeFromSuperview];
[self.view removeFromSuperview];
[superView.layer addAnimation:animation forKey:@"removeContentAnimation"];
self.view 和 root.view 被添加到“superView”中
当我提交这个动画时,有一点机会发生错误 - 两个视图都从 superView 中删除并立即返回。快速更改后,它正常消失了。
【问题讨论】:
-
问题不是很清楚,错误是什么? self.view 和 root.view 是什么?
标签: iphone objective-c animation