Limit height of ListView on Android

后端 未结 16 1357
广开言路
广开言路 2020-11-28 23:07

I want to show a button under a ListView. Problem is, if the ListView gets extended (items added...), the button is pushed out of the screen.

16条回答
  •  被撕碎了的回忆
    2020-11-28 23:48

    Using LinearLayout, set the height of your ListView and Button to wrap_content and add a weight=1 to ListView. This should work as you want.
    And yes, set the layout_gravity of the Button to bottom

提交回复
热议问题