首页 > 移动平台 > 详细

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

时间:2015-11-10 09:20:14      阅读:544      评论:0      收藏:0      [点我收藏+]
<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的总高度。

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

原文:http://www.cnblogs.com/qjm201000/p/4951883.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!