我正在尝试对一个视图进行动画处理,使其在进入屏幕后反弹一次。
下面是我正在进行的滑动动画基本示例:
// The view is added with a rect making it off screen.
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDuration:0.07];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
[theView setFrame:CGRectMake(-5, 0, theView.frame.size.width, theView.frame.size.height)];
[UIView commitAnimations];
在didStopSelector中调用更多的动画来实现弹跳效果。问题是当有多个视图被动画化时,弹跳变得不流畅,不再弹跳。
在我开始研究如何在核心动画中实现这一点之前,(我知道这有点困难),我想知道使用核心动画是否真的比UIView动画有优势。如果没有,有什么方法可以提高性能吗?