Animate view sliding out of another view, pushing views below out of the way

后端 未结 7 1569
野趣味
野趣味 2020-12-22 21:27

I have a list of buttons. When I press a button, a View should slide in a downwards motion out of the button, like this:

Start:

7条回答
  •  Happy的楠姐
    2020-12-22 21:59

    Use something like:

     Animation a = new ScaleAnimation(1, 1, 0, 1, Animation.RELATIVE_TO_SELF, (float) 0.5,    Animation.RELATIVE_TO_SELF, (float) 0);
     a.setFillAfter(true);
     view.setAnimation(a);
     a.setDuration(1000);
     view.startAnimation(a);
    

提交回复
热议问题