我試圖操縱該操作來執行以下操作,但到目前爲止只是導致沮喪...以下是我試圖完成的很糟糕的畫面:如何操縱Android xml中的ListView和佈局
http://i.stack.imgur.com/WZOta.png
http://i.stack.imgur.com/6cEQk.png
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<ListView
android:id="@+id/android:list"
android:layout_width="wrap_content"
android:layout_height="419dp" >
</ListView>
<TextView
android:id="@+id/android:empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/FAP001"
/>
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="+1" />
</LinearLayout>
</ScrollView>
林不知道,如果列表視圖是要走的路..挫折感即時通訊甚至不知道的LinearLayout是一個良好的通話..我試着去有接近最終的結果是什麼在第二張圖片上。 感謝提前!
ListView本身就是一個滾動視圖,所以不應該包含在ScrollView中。從你的草圖中,ListView絕對是正確的方法。 – CSmith 2012-08-06 19:58:00
如果你想要的是每個項目中有幾個「可配置」字段的列表視圖,也許你應該考慮使用listadapter和arrayadapter。檢查這個鏈接。 http://www.vogella.com/articles/AndroidListView/article.html希望是你需要的。 – luanjot 2012-08-06 20:00:16