问题
How to get Position of moving view using translate animation.
TranslateAnimation animation = new TranslateAnimation(0.0f, 300.0f,
0.0f, 0.0f);
animation.setDuration(500);
animation.setFillAfter(true);
mainview.startAnimation(animation);
回答1:
You need to set a new AnimationListener, before the startAnimation command. You can use Override methods of AnimationListener and please debug it for a better understanding. You need setAnimationListener before starting your animation.
来源:https://stackoverflow.com/questions/62246817/how-to-get-positon-in-translateanimation