Animate Android ListView to slide up and down like

2019-07-11 21:03发布

I want to include a ListView in my Android (2.2) application similar to the notification list that is coming from the top. Here I want it from bottom. The list should show always the top part and when slided up enlarge to 80% of the screen. When slided down, it should go back in its original size.

I tried several alternatives which did not work:

  • Tweed animations always enlarge the part that is visible, not the real content
  • Manual slide up in steps with an animation loop with onAnimationRepeat as it each time has to calculate the full layout after resizing, each step is slow and so the moving is quite bad
  • Layout animations seem not to be a solution as the view is always visible and so it can not be animated during showing up.

Thanks for your help.

1条回答
Explosion°爆炸
2楼-- · 2019-07-11 21:59

Look at the Android Sliding Drawer:

It will slide from the bottom, and you can place a ListView inside it.

It should look something like this:

enter image description here

Here is a tutorial:

查看更多
登录 后发表回答