How to get positon in TranslateAnimation?

我的梦境 提交于 2020-06-29 05:06:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!