How to animate a View's translation

前端 未结 3 1444
深忆病人
深忆病人 2020-12-14 18:22

At the first click of a button, I want to slide a View along the x-axis (by 200 pixels to the right let\'s say). And on the second press of the button, I want t

3条回答
  •  囚心锁ツ
    2020-12-14 19:00

    I had a similar issue, TranslateAnimation does actually move the view if you call setFillAfter now (android bug). I had to do something similar so I said, hey lets use an animation listener and then just move everything to the correct location. Unfortunately there is a bug on animation listeners as well (stackoverflow solution). So I created my own layout class according to the solution in the stackoverflow solution and I was good to go :)

提交回复
热议问题