【发布时间】:2010-12-20 12:20:50
【问题描述】:
单击按钮时我需要重新启动动画。
这是我的动画的代码:
imgStar.frame = CGRectMake(205, 6, imgStar.frame.size.width, imgStar.frame.size.height);
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.5];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
imgStar.transform = CGAffineTransformMakeTranslation(-4, 340);
[UIView commitAnimations];
问题是:当我重新单击(第二次单击)按钮时,动画不起作用!
你能帮帮我吗?
【问题讨论】:
-
为什么这个动画第二次不起作用?
标签: iphone cocoa-touch animation uiimageview