I have a layout with 3 button at the top in a row and then a ListView followed by a button below the listView.
This is my layout.xml file
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button android:id="@+id/btn_top10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TOP 10"/>
<Button android:id="@+id/btn_top100"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TOP 100"
android:layout_toRightOf="@id/btn_top10"/>
<Button android:id="@+id/btn_showAll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Show All"
android:layout_toRightOf="@id/btn_top100"/>
<ListView android:id="@+id/LV_Device"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/btn_top10"
android:layout_above="@id/LV_Device"/>
<Button android:id="@+id/btn_clearResult"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Clear Results"
android:layout_below="@id/LV_Device"/>
</RelativeLayout>
This will give a result like this

If i add some values to the ListView then its ok, the button below will be show

But if the listview becomes larger than the screen size then the button below that will not be visible even after scrolling to the bottom of the listView

How to solve this issue?? I don’t want button to be fixed at the bottom of the screen. I want the button to be show at the end of the ListView only
Change your
ListView‘s height to0dip. Then change the attributeto
Finally, modify the last button by removing
android:layout_belowand add insteadandroid:layout_alignParentBottom="true".