Android: Animation Position Resets After Complete

后端 未结 9 1539
南笙
南笙 2020-11-27 13:30

I\'m using an xml defined animation to slide a view off the screen. The problem is, as soon as the animation completes it resets to its original position. I need to know how

9条回答
  •  盖世英雄少女心
    2020-11-27 13:53

    You need to add this command:

    final Animation animSlideLeft = new TranslateAnimation(0, -80, 0,-350, 0, 0, 0, 0);
    animSlideLeft.setFillAfter(true);
    

提交回复
热议问题