下载此文档

android可展开(收缩)的列表ListView(ExpandableListView)=.doc


文档分类:IT计算机 | 页数:约7页 举报非法文档有奖
1/7
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/7 下载此文档
文档列表 文档介绍
android可展开(收缩)的列表ListView(ExpandableListView)每天都在用QQ聊天,今天突然一想,android怎么实现列表的分组展开呢?看了看api,发现其实现过程也很简单。先看一下最终效果吧!1、首先创建我们的Activity,,直接看代码吧。.;;;.;/******@authorIdeasAndroid*可展开(收缩)列表示例*/lassIdeasExpandableListViewextendsExpandableListActivity{  ***@Override  publicvoidonCreate(BundlesavedInstanceState){      (savedInstanceState);      //设置列表适配器IdeasExpandableListAdapter      setListAdapter(newIdeasExpandableListAdapter(this));  }}复制代码2、创建适配器,。.;;;;;;;;;;/******@authorIdeasAndroid *可展开(收缩)列表示例*/lassIdeasExpandableListAdapterextendsBaseExpandableListAdapter{    privateContextmContext=null;    //测试数据,开发时可能来自数据库,网络....    privateString[]groups={"家人","朋友","同事"};    privateString[]familis={"老爸","老妈","妹妹"};    privateString[]friends={"小李","张三","李四"};    privateString[]colleagues={"陈总","李工","李客户"};    privateList<String>groupList=null;    privateList<List<String>>itemList=null;    publicIdeasEx

android可展开(收缩)的列表ListView(ExpandableListView)= 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数7
  • 收藏数0 收藏
  • 顶次数0
  • 上传人s0012230
  • 文件大小70 KB
  • 时间2018-09-21