【发布时间】:2010-08-10 14:00:09
【问题描述】:
需要计算一些转换代码来实现自然落下,就像树叶从树上掉下来一样。
这里有一些代码,以一定的旋转角度从一个地方飞到另一个地方。
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:5.0];
[UIView setAnimationDelegate:self];
//[UIView setAnimationRepeatCount:1e100f]; //coutless
[UIView setAnimationRepeatCount:1]; // 1 time
//[UIView setAnimationRepeatAutoreverses:YES];
leaf2.frame = CGRectMake(LEAF2_X, LEAF2_Y, LEAF2_W, LEAF2_H);
leaf2.transform = CGAffineTransformMakeRotation(ANGLE);
[UIView commitAnimations];
【问题讨论】: