gpt4 book ai didi

java - 如何获取 TranslateAnimation 中的位置?

转载 作者:行者123 更新时间:2023-12-01 16:21:57 27 4
gpt4 key购买 nike

如何使用平移动画获取移动 View 的位置。

TranslateAnimation animation = new TranslateAnimation(0.0f, 300.0f,
0.0f, 0.0f);
animation.setDuration(500);
animation.setFillAfter(true);
mainview.startAnimation(animation);

最佳答案

您需要在 startAnimation 命令之前设置一个新的 AnimationListener。您可以使用AnimationListener的Override方法并进行调试以便更好地理解。在开始动画之前,您需要 setAnimationListener。

关于java - 如何获取 TranslateAnimation 中的位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62246817/

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