如何制作具有随机持续时间的android动画

时间:2013-08-04 09:24:44

标签: android android-animation

我使用简单的动画来移动或旋转对象。比如下面的代码。我想在连续动画中使用随机持续时间。它将是一个动画或一组动画。有没有简单的方法呢?有没有机会在不停止动画的情况下做到这一点?非常感谢您的提示。

<set xmlns:android="http://schemas.android.com/apk/res/android"       
android:interpolator="@android:anim/accelerate_decelerate_interpolator">
<translate android:fromXDelta="80%p" android:toXDelta="0%" 
android:fromYDelta="100%p" android:toYDelta="0%"
android:duration = "3000" />
</set>

1 个答案:

答案 0 :(得分:0)

我将在下面的链接中找到sollution的答案。这会动态调整动画的持续时间并解决我的问题。

How to dynamically adjust the duration/speed of a Tween Animation in Android