Android: 如何避免动画结束后重启?

Android: How to avoid restart after Animation finish?

动画结束后图片会回到0,0 怎么设置不回去? 仍停留在100,100

Animation am = new TranslateAnimation((float)0(), (float)100, (float)0,(float)100);

am.setDuration(5000);
am.setRepeatCount(0);
point.startAnimation(am);

使用Animation.setFillAfter(true)保持最终动画状态。

http://developer.android.com/reference/android/view/animation/Animation.html#setFillAfter(boolean)

If fillAfter is true, the transformation that this animation performed will persist when it is finished. Defaults to false if not set. Note that this applies to individual animations and when using an AnimationSet to chain animations.

Animation am = new TranslateAnimation((float)0(), (float)100, (float)0,(float)100);

am.setDuration(5000);
am.setFillAfter(true);
am.setRepeatCount(0);
point.startAnimation(am);