开发者

how to restart the UIView animation

开发者 https://www.devze.com 2022-12-14 10:46 出处:网络
I am new to the objective c coding in iPhone. i am using below code in separate function to start t开发者_JS百科he animation.

I am new to the objective c coding in iPhone. i am using below code in separate function to start t开发者_JS百科he animation.

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:10.0];
object.transform = CGAffineTransformMakeRotation(1.57);
[UIView commitAnimations];

After this i am trying to restart the animation in one more separate function, before the time (10 sec that is mentioned in above).

So the thing is if i want to restart the animation in another function(but in the same .m file)once again at 5th sec. So please tell me how to solve this issue.


If you start a new animation while one is already in process for the same property/ies it should start animating to the new property values from whatever the current values are, using the new animation settings.

So when you say you want to reset the animation, do you mean you want it to go back to the start, or just do something different? If the former I believe you'll just need to set the property/ies (in this case your transform) back to its initial settings and start a new animation block.

0

精彩评论

暂无评论...
验证码 换一张
取 消