我想在ScrollView
以下安裝一個ListView
。我試圖把他們一個LineaLayout
內像這樣ListView下面的滾動視圖在Android中
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/frameLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ScrollView
android:id="@+id/marketDetailScrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
...
</ScrollView>
<ListView android:id="@android:id/list"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:background="#FFF"/>
</LinearLayout>
和ListView
不會得到顯示。我也試過把它放在RelaviteLayout
裏面,但什麼也沒有。我能以某種方式在ScrollView
下有ListView
嗎?
只是爲了添加一些東西。我不想分割我的屏幕,因此我有一半用ScrollView
,另一半用ListView
。我希望用戶向下滾動ScrollView
這顯然是比屏幕尺寸再大一點的ListView
應該開始
修復滾動視圖的高度..就像'android:layout_height =「100dip」' –
你可以讓listview在scrollview中將視圖作爲頁眉或頁腳添加到listview(不帶scrollview)或指定滾動視圖的固定高度並在其下面添加listview – Raghunandan
在你的滾動視圖中,'android:layout_height =「fill_parent」'意味着你的滾動視圖將把所有空間都放在最下面,所以你的ListView沒有更多的空間。 –