TranslateAnimation处于反向位置?

Waq*_*mad 5 android translate-animation

我在使用TranslateAnimation的应用程序,但我想将TranslateAnimation反转到开始位置.

    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);

        setContentView(R.layout.imageviewactivity);

        TranslateAnimation toptranslateanimation = new TranslateAnimation(0, 0, tempBar,
                    scanner_image.getHeight() - 50);
        toptranslateanimation.setDuration(4000);
            toptranslateanimation.setAnimationListener(this);
                scanning_bar.setAnimation(toptranslateanimation);
}
Run Code Online (Sandbox Code Playgroud)

Att*_*lah 6

尝试使用此代码

toptranslateanimation.setRepeatCount(1);
toptranslateanimation.setRepeatMode(Animation.REVERSE);
Run Code Online (Sandbox Code Playgroud)