我使用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条答案
按热度按时间uinbv5nw1#
添加这行代码:
字符串
beq87vna2#
您可以在第二个Animator(即
out.setStartDelay(1000)
)上设置开始延迟,然后再将其添加到集合中。dluptydi3#
使用
AnimatorSet.after(long delay)
函数,而不是在各个动画上设置开始延迟。字符串
AnimatorSet.Builder