我需要按鈕出現在列表視圖下方。任何幫助將不勝感激。我已經嘗試了不同的方式來讓這個特定的佈局在Android上正確顯示,但到目前爲止我還沒有弄清楚這一點。我希望能夠在應用程序中間顯示一個列表視圖,並在列表視圖下有按鈕。問題是我有其他的東西需要顯示在列表視圖頂部的屏幕上,如標籤和旋鈕。列表視圖中的所有項目都將同時具有圖像和圖像右側的一些文本。我想實現的圖像是這樣的形象...android應用程序中的listview下的按鈕
這裏是我到目前爲止的代碼...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:maxLines="100"
android:orientation="vertical"
android:scrollbars="vertical" >
<Button
android:id="@+id/readWebpage"
android:layout_width="match_parent"
android:layout_height="40dp"
android:onClick="onClick"
android:text="Load Webpage" >
</Button>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLines="100"
android:gravity="center"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:orientation="horizontal">
<Spinner
android:id="@+id/genre"
android:entries="@array/genre_list"
android:layout_weight="0.40"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="1dp" />
<Spinner
android:id="@+id/sort"
android:entries="@array/sort_list"
android:layout_weight="0.40"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="1dp" />
<Spinner
android:id="@+id/page"
android:entries="@array/page_list"
android:layout_weight="0.20"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="1dp" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/listView" />
<Button
android:id="@+id/previousPage"
android:layout_weight="0.50"
android:layout_width="0dp"
android:layout_height="40dp"
android:onClick="onClick"
android:layout_alignParentBottom="true"
android:text="Previous Page" >
</Button>
<Button
android:id="@+id/nextPage"
android:layout_weight="0.50"
android:layout_width="0dp"
android:layout_height="40dp"
android:onClick="onClick"
android:layout_alignParentBottom="true"
android:text="Next Page" >
</Button>
</LinearLayout>
</LinearLayout>
這幫助我看到如何正確設置我的代碼。謝謝! – hopefulcd