2010-02-28 107 views
1

有了這個XML觀點:爲什麼此Android視圖不能垂直填充屏幕?

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    android:id="@+id/myScrollLayout" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" 
    xmlns:android="http://schemas.android.com/apk/res/android"> 
    <ScrollView 
     android:id="@+id/widget29" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 
     <ListView 
      android:id="@+id/lstView1" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"> 
     </ListView> 
    </ScrollView> 
</LinearLayout> 

alt text http://img528.imageshack.us/img528/3603/ss3v.jpg

爲什麼我的ListView只顯示第一個項目,不填充屏幕?

回答

2

請勿將ListView放入ScrollView之內。 ListView已經知道如何滾動。