我正在开发使用了 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);
}
最佳答案
尝试使用这段代码
toptranslateanimation.setRepeatCount(1);
toptranslateanimation.setRepeatMode(Animation.REVERSE);
关于android - TranslateAnimation 处于相反位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30214663/