我的应用程序中有以下核心动画代码:
-(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];
}
谢谢,
马丁