0

我使用AnimatorSet playSequentially方法是這樣的:如何在AnimatorSet中的動畫之間添加延遲playSequentially()?

AnimatorSet set = new AnimatorSet(); 
ObjectAnimator in = ObjectAnimator.ofFloat(splash, "alpha", 0f, 1f); 
in.setDuration(2500); 
in.setInterpolator(new AccelerateInterpolator()); 
ObjectAnimator out = ObjectAnimator.ofFloat(splash, "alpha", 1f, 0f); 
out.setDuration(2500); 
out.setInterpolator(new AccelerateInterpolator()); 

set.playSequentially(in,out); 

我喜歡對子級添加動畫1和2之間的延遲,例如:

set.playSequentially(in,1000,out); 

,能夠添加的動畫之間的延遲使用playSequentially方法?

謝謝。

回答

3

加入這行代碼:

out.setStartDelay(1000); 
1

你可以將它添加到組前設置2號動畫(即out.setStartDelay(1000))的啓動延遲。