1

我有一个 ListView,下面有一个 Button。当我用比屏幕大小允许的更多内容填充列表时,出现滚动条时,按钮不是可滚动区域的一部分。也就是说,按钮消失了。如何使按钮成为可滚动区域的一部分?

<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>
4

2 回答 2

2

将其作为页脚添加到 ListView 。

于 2010-06-30T13:20:37.807 回答
2

使用addFooterView()添加它。这样,当 ListView 仍在滚动时,它将始终显示在屏幕底部。

于 2010-06-30T13:22:11.847 回答