我正在创建一个动画,AnimatorSet
当它结束时,我想离开View
它原来的位置。
代码是这样的:
mLastAnimation = new AnimatorSet();
mLastAnimation.playTogether(
ObjectAnimator.ofFloat(mImageView, "scaleX", 1.5f, 1f),
ObjectAnimator.ofFloat(mImageView, "translationY", 40f, 0f));
mLastAnimation.setDuration(3000);
mLastAnimation.addListener(this);
mLastAnimation.start();
// The Activity implements the AnimatorListener interface
@Override
public void onAnimationEnd(Animator animator) {
// Undo the animation changes to the view.
}
编辑:
我正在使用新的动画 API,所以setFillAfter()
在这里不起作用。