0
這些是我在xml中設置的animator,我想轉換爲java代碼,但是我不知道如何在「AnimatorSet」中設置「AnimatorSet」?Android ObjectAnimatorSet XML轉換爲JAVA代碼
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:ordering="sequentially">
<set>
<objectAnimator
android:duration="50"
android:propertyName="scaleX"
android:valueFrom="1.0"
android:valueTo="0.8" />
<objectAnimator
android:duration="50"
android:propertyName="scaleY"
android:valueFrom="1.0"
android:valueTo="0.8" />
</set>
<set>
<objectAnimator
android:duration="50"
android:propertyName="scaleX"
android:valueFrom="0.8"
android:valueTo="1.1" />
<objectAnimator
android:duration="50"
android:propertyName="scaleY"
android:valueFrom="0.8"
android:valueTo="1.1" />
</set>
</set>
'AnimatorSet'播放多個'Animator's和'AnimatorSet'是'Animator',因爲它擴展了'Animator',所以你可以播放多個'AnimatorSet' – pskink
ha,我明白了,非常感謝 –
,但是老實說你可以在ObjectAnimator#ofFloat'方法中調用 – pskink