Android 自定义Adapter 但listview 只显示第一条数据

<ScrollView
      android:layout_width="fill_parent"	  
      android:layout_height="wrap_content"
      >
     
  <!-- listview -->	
      <ListView android:id="@+id/listview1" android:layout_width="fill_parent"
      android:layout_height="fill_parent" android:drawSelectorOnTop="false"
      android:background="@drawable/home_index_btn_d"
      android:fadingEdge="none"
      android:cacheColorHint="#00000000"
      
      android:scrollbars="vertical" />

   </ScrollView>

listView中包裹着scrollview就会出现这个情况。
方法有两种:

第一种:禁用ListView的滚动(Scroll)。

第二种:计算ListView中每一项的高度,然后根据每一项的高度“乘以”项数,计算出ListView的总高度。

原文地址:https://www.cnblogs.com/qjm201000/p/4951883.html