你好,游客 登录 注册 搜索
背景:
阅读新闻

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

[日期:2014-05-19] 来源:Linux社区  作者:fangchao3652 [字体:大 中 小]

Android 自定义Adapter 但listview 只显示第一条数据这个问题郁闷了一晚上。在logcat里明明显示adapter的getview方法里的list大于一条数据 ,但posotion却一直是0.。运行后也只显示list[0]里面的数据。最后的最后原来错误出在布局文件上

-------------------------------------------分割线-------------------------------------------

Ubuntu 14.04 x64配置Android 4.4 kitkat编译环境的方法 http://www.linuxidc.com/Linux/2014-05/101148.htm

Ubuntu 12.04搭建Android开发环境 http://www.linuxidc.com/Linux/2012-09/69961.htm

Ubuntu 14.04 配置 Android SDK 开发环境 http://www.linuxidc.com/Linux/2014-05/101039.htm

64位Ubuntu 11.10下Android开发环境的搭建(JDK+Eclipse+ADT+Android SDK详细) http://www.linuxidc.com/Linux/2013-06/85303.htm

Ubuntu 12.10 x64 安装 Android SDK http://www.linuxidc.com/Linux/2013-03/82005.htm

-------------------------------------------分割线-------------------------------------------

我以前的是这样的;

<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>

都是这个ScrollView惹的祸。。。去掉之后  就OK了 

更多Android相关信息见Android 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=11

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-05/101946.htm

linux
相关资讯       Android ListView 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款