3
我使用下面的代碼來做一個字符串滾動,但如何停止動畫?如何使用beginAnimations後停止動畫?
[UIView beginAnimations:@"ruucc" context:NULL];
[UIView setAnimationDuration:12.8f];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationDelegate:self];
[UIView setAnimationRepeatAutoreverses:NO];
[UIView setAnimationRepeatCount:999999];
frame = label1.frame;
frame.origin.x = -12;
label1.frame = frame;
[UIView commitAnimations];
請參閱http://stackoverflow.com/questions/554997/cancel-a-uiview-animation – 2010-03-20 02:41:19