2010-03-18 31 views
0

我完全難住這一個。我有三個不同的列表需要在屏幕上顯示。 我已經嘗試使用帶有LinearLayout子項的ScrollView,並將我的ListViews放入LinearView中,但所有ListViews都使用滾動條鎖定到固定高度。使用其他類型的佈局意味着不滾動。我想在滾動上顯示此列表視圖

+2

列表視圖知道如何滾動。你不必把它放在滾動視圖中。畫一張圖片,告訴我們你想達到什麼目的。 – Pentium10 2010-03-18 14:32:17

+1

你不但不需要將它放在'ScrollView'中,它不會在'ScrollView'中工作。 – CommonsWare 2010-03-18 14:45:44

回答

0

線性佈局中列表視圖的高度取決於您如何加權。

你有一些示例代碼?

試試這個佈局(未測試)

<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:width="fill_parent" 
android:height="fill_parent" 
android:orientation="vertical" 
> 

<ListView 
android:id="@+id/list1" 
android:width="fill_parent" 
android:height="fill_parent" 
android:layout_weight="1" 
> 

<ListView 
android:id="@+id/list2" 
android:width="fill_parent" 
android:height="fill_parent" 
android:layout_weight="1" 
> 

<ListView 
android:id="@+id/list3" 
android:width="fill_parent" 
android:height="fill_parent" 
android:layout_weight="1" 
> 

</LinearLayout>