【发布时间】:2013-03-12 12:47:03
【问题描述】:
在我的应用程序中,我正在根据加速度计移动球,但球没有平稳移动。我需要在视图中平稳移动球。我该怎么做?
我通过在google上搜索使用了以下语句。但我没有得到平滑的对象
delta.x = 0.01 * delta.x + (1.0 - 0.01) * acceleration.x;
delta.y = 0.01 * delta.y + (1.0 - 0.01) * acceleration.y;
【问题讨论】:
-
编写您的 CGAffineTransformMakeTranslation 动画以获得流畅的动画动作。您可以为此使用基本的 UIViewAnimation 块。
标签: iphone ios ipad object accelerometer