2012-06-08 144 views
0

我有一個夾在兩個按鈕之間的ListView。整個屏幕處於ScrollViewAndroid:展開ListView以填充兩個項目之間的空間

<Button 
     android:text="Take a Picture" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/btnPicture" 
     android:layout_marginRight="3dp" 
     android:layout_marginLeft="3dp" 
     android:layout_marginTop="5dp" 
     android:textSize="25dp"/> 
    <ListView 
     android:minWidth="25px" 
     android:minHeight="25px" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/lstPhotos" 
     android:visibility="gone" /> 
    <Button 
     android:text="Location Type" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/btnLocationType" 
     android:layout_marginRight="3dp" 
     android:layout_marginLeft="3dp" 
     android:layout_marginTop="5dp" 
     android:textSize="25dp" /> 

當我將項目添加到代碼中的列表視圖,我怎麼能得到列表視圖佔用足夠的空間可見。它確實擴展爲顯示1個項目,但在添加第二個項目後,它不再擴展。

在添加第二個圖片行到列表視圖後,您可以看到這裏,它不可見。

enter image description here

回答

相關問題