@Artoo是正确的,你能做的最好的事情是有你的ListView上面一个TextView,你可以有任何填充添加到它作为没有关联你的ListView。
下面是我的代码片段。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="20dp"
android:text="I am Header"/>
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
</ListView>
,这里是我的输出。 (我知道它看起来怪异),但它的作品。 :)
如果您需要进一步的帮助,请告诉我。快乐的编码。 :)
您必须为ListView项目和标题视图分开布局。所以,从ListView中删除填充并将其移动到项目的布局和标题的布局。 –
您能否通过放置图像来解释这一点,并在那里表明究竟是什么问题? –