【发布时间】:2011-03-24 20:47:40
【问题描述】:
我在 iPhone 上的游戏中使用核心动画来闪现中间分数(使用 UILabel)。我需要它重复特定命中的特定计数。
分数需要闪烁特定计数,然后消失。
所以它应该从 alpha 0.0 -> 1.0 -> 0.0
下面是我试图实现这一点的代码。
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationRepeatCount:repeatCount];
[UIView setAnimationRepeatAutoreverses:YES];
playerScore.alpha = 1.0f;
[UIView commitAnimations];
问题是动画结束后,alpha回到1.0
有什么建议吗?
【问题讨论】:
标签: ios core-animation