gpt4 book ai didi

android - TranslateAnimation 处于相反位置?

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:25:43 26 4
gpt4 key购买 nike

我正在开发使用了 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com