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)之間存在一個導致口吃的小間隙。誰能幫忙?
感謝,
馬丁