首页
学习
活动
专区
圈层
工具
发布
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    笔记41 | Android加载器Adapter的几个练习

    SimpleAdapter有最好的扩充性,可以自定义出各种效果。 ---- ArrayAdapter ? 列表的显示需要三个元素: a.ListVeiw 用来展示列表的View。...simpleAdapter的扩展性最好,可以定义各种各样的布局出来,可以放上ImageView(图片),还可以放上Button(按钮),CheckBox(复选框)等等。...使用simpleAdapter的数据用一般都是HashMap构成的List,list的每一节对应ListView的每一行。HashMap的每个键值数据映射到布局文件中对应id的组件上。...下面做适配,new一个SimpleAdapter参数一次是:this,布局文件(vlist.xml),HashMap的 title 和 info,img。...simpleAdapter = new SimpleAdapter(getActivity(), getData(), R.layout.list_item, new String[] {"title

    65330

    跟我学Android之十一 列表和适配器

    ØSimpleAdapter:并不简单、功能强大的Adapter。可用于将List集合的多个对象包装成多个列表项。 ØBaseAdapter通常用于被扩展。...概述 SimpleAdapter可以用于显示复杂数据 uSimpleAdapter可以在列表的一项中提供和显示多个数据 uSimpleAdapter需要自定义数据结构和显示视图布局...uSimpleAdapter的构造需要5个参数 Øcontext:为使用SimpleAdapter的上下文 Ødata:为用于显示的具体数据 l这是一个map对象的list,list中的每一项是一个...Ø布局文件:R.layout.simple_item Ø该文件包含一个头像ImageView,名字TextView,简介TextView 显示复杂列表,然后在ListView中使用SimpleAdapter...SimpleAdapter simpleAdapter = new SimpleAdapter(this, listItems, R.layout.simple_item, new String

    61010
    领券