0
我在我的应用程序下面的核心动画代码:iPhone核心动画不能平滑运行?
-(void)startCoreAnimation
[UIView beginAnimations:@"IconFade" context:Icon];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationDuration:1];
[UIView setAnimationRepeatAutoreverses:YES];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
icon.alpha=0.0;
[UIView commitAnimations];
break;
,然后在动画完成:
-(void)animationFinished : (NSString *)theAnimation finished : (BOOL)flag context : (void *)context {
((UIView *)context).alpha = 1.0;
((UIView *)context).transform = CGAffineTransformIdentity;
[self startCoreAnimation];
}
的问题是,经过动画完成图标“跳”回它的alpha状态为1.它看起来像图标淡入淡出,然后不利然后进入alpha 0,然后返回到alpha 1.在最后两个步骤(alpha 0到alpha1)之间存在一个导致口吃的小间隙。谁能帮忙?
感谢,
马丁