SimpleAdapter作为一个数据集,主要向ListView、GridView容器填充数据,总结了几种填充方式,原理很简单,直接看代码和效果图


1、 ListView单行显示(simple_list_item_1)

代码:

效果:

Android SimpleAdapter显示ListView、GridView


2、 ListView双行显示(simple_list_item_2)

代码:

效果:
Android SimpleAdapter显示ListView、GridView


3、 ListView自定义显示

代码:

自定义的 listitem.xml

效果:

Android SimpleAdapter显示ListView、GridView


4、 GridView自定义显示

代码:

自定义的 gridview.xml

效果:

Android SimpleAdapter显示ListView、GridView



源码下载


相关文章:

  • 2021-10-26
  • 2022-01-03
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2021-10-23
  • 2021-04-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
  • 2021-05-26
  • 2021-05-22
  • 2021-12-31
  • 2022-12-23
相关资源
相似解决方案