views:

58

answers:

2

I have a ListView with a Button below it. When I fill the list with more content than the screen size allows, so that the scroll bar appears, the Button is not part of the scrollable area. That is, the Button disappears. How do I make the Button part of the scrollable area?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <ListView android:id="@+id/ListView" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_above="@+id/AddButton" />

    <Button android:id="@+id/AddButton" android:layout_width="fill_parent" 
        android:layout_height="wrap_content" android:text="@string/add_title" />
</RelativeLayout>
+2  A: 

Hi,

Add it to the ListView as footer.

ognian
+2  A: 

Add it with addFooterView(). This way it will always appear at the bottom of the screen while the ListView still scrolls.

BrennaSoft