我想製作一個順序動畫,其中兩個按鈕收縮直到它們消失,然後再次增長到原始大小。 當我運行它的按鈕地消失,沒有任何動畫Android縮小和增長順序動畫
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fillAfter="true">
<scale
android:fromXScale="1"
android:toXScale="0"
android:fromYScale="1"
android:toYScale="0"
android:duration="400"
android:pivotX="50%"
android:pivotY="50%"
/>
<scale
android:startOffset="700"
android:fromXScale="0"
android:toXScale="1"
android:fromYScale="0"
android:toYScale="1"
android:duration="400"
android:pivotX="50%"
android:pivotY="50%"
/>
</set>
Animation sgAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.shrink_grow);
btPrimary.startAnimation(sgAnimation);
btSecondary.startAnimation(sgAnimation);
當你離開的第二個'scale'動畫會發生什麼?按鈕縮小了嗎? – Axarydax
是的,兩個動畫單獨工作 – JoeyCK