【问题标题】:animation effects : leaf falling down to ground动画效果:树叶落到地上
【发布时间】: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];

【问题讨论】:

    标签: iphone animation


    【解决方案1】:

    【讨论】:

    • 是的,有帮助。实际上我需要像曲线一样找出一条路径。所以需要一些变换组合矩阵等。
    猜你喜欢
    • 2017-06-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-23
    • 1970-01-01
    • 2015-01-11
    • 2018-05-05
    相关资源
    最近更新 更多