Limit height of ListView on Android

后端 未结 16 1337
广开言路
广开言路 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:45

    On your last edit, you just have to also add android:layout_above="@+id/butt1" in your ListView code.

    And to show you(and everybody here who tried an answer earlier) that you really don't need to use more than one RelativeLayout, here is your corrected code:

       
        
        
        
        
        
        
        
    

    and the result, using some random list:
    enter image description here

提交回复
热议问题