Android -> how to animate to the new position

后端 未结 3 1109
粉色の甜心
粉色の甜心 2021-02-02 15:58

Here is simple xml android animation:



        
3条回答
  •  孤独总比滥情好
    2021-02-02 16:22

    If you want it to work on all screens you aren't going to be able to hardcode x,y values. Animations allow you to use percents. This animation would move your view from 0% x and y(relative to itself. In other words where ever it is before the animation it will start from there) It will move to 0%p x and y (which means 0% relative to the parent) This should take you to the top left. Depending on how far into the corner you want it you may try 5%p or 10%p to get some extra margin.

    
    

提交回复
热议问题