本文介绍了UIView动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试为UIView
设置动画.它看起来像一个矩形,我只想将其转换为我的坐标.
I am trying to animate a UIView
here. It looks like a rectangle, and I just want to translate it to my coordinations.
那么,我该如何对其进行动画处理?我试图找到一些教程,但没有成功.
So, how can I animate it? I tried to find some tutorials, but without success.
推荐答案
以下是为视图移动动画而移出屏幕的示例.您应该可以根据自己的需要对其稍作调整:
Here is an example of animating a view to move off screen. You should be able to slightly adjust it for your needs:
[UIView beginAnimations:@"bucketsOff" context:nil];
[UIView setAnimationDuration:0.4];
[UIView setAnimationDelegate:self];
//position off screen
[bucketView setCenter:CGPointMake(-160, 377)];
[UIView setAnimationDidStopSelector:@selector(finishAnimation:finished:context:)];
//animate off screen
[UIView commitAnimations];
这篇关于UIView动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!