1

I am using this code to make an animation. My question is how do I stop the animation? Don't tell me to change the repeat count either. I want the animation to work until I say stop. Is there a method that I can use to achieve this?

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationRepeatAutoreverses:YES];
[UIView setAnimationRepeatCount:INFINITY];
[[menuViewOne loadBut] setFrame:CGRectMake(230, 35, 150, 25)];
[UIView commitAnimations];
4

1 回答 1

0

您可以使用块来使用开始停止动画。文档不推荐 commitAnimations。

从文档。

在 iOS 4.0 及更高版本中不鼓励使用此方法。您应该使用基于块的动画方法来指定您的动画。

于 2011-05-01T23:23:28.260 回答