前言

  本章内容是android.widget.ResourceCursorTreeAdapter,版本为Android 3.1 r1,为Android 3.0 r1新增API,翻译来自"xiaoQLu",欢迎访问它的博客:"http://www.cnblogs.com/xiaoQLu",再次感谢"xiaoQLu" !期待你一起参与Android API的翻译,联系我over140@gmail.com。

声明

  欢迎转载,但请保留文章原始出处:)

    博客园:http://www.cnblogs.com/

    Android中文翻译组:http://goo.gl/6vJQl

结构

继承关系

public abstract classt ResourceCursorTreeAdapter extends CursorTreeAdapter

java.lang.Object

android.widget.BaseExpandableListAdapter

android.widget.CursorTreeAdapter

android.widget.ResourceCursorTreeAdapter

直接子类

SimpleCursorTreeAdapter

类概述

一个简单的可扩展的ExpandableListAdapter,通过在XML文件来创建views。你可以指定一个定义了views外观的XML文件。

构造函数

public ResourceCursorTreeAdapter (Context context, Cursor cursor, int collapsedGroupLayout, int expandedGroupLayout, int childLayout, int lastChildLayout)

构造函数。

参数

context 和正在运行的SimpleListItemFactory关联的ListView的上下文

cursor 数据库游标

collapsedGroupLayout 定义了收缩组的视图布局文件的资源标识

expandedGroupLayout 定义了展开组的视图布局文件的资源标识

childLayout 定义了除了最后一个的所有子视图的布局文件的资源标识

lastChildLayout 定义了一组中最后一个子视图的布局文件的资源标识

public ResourceCursorTreeAdapter (Context context, Cursor cursor, int collapsedGroupLayout, int expandedGroupLayout, int childLayout)

构造函数。

参数

context 和正在运行的SimpleListItemFactory关联的ListView的上下文

cursor 数据库游标

collapsedGroupLayout 定义了收缩组的视图布局文件的资源标识

expandedGroupLayout 定义了展开组的视图布局文件的资源标识

childLayout 定义了除了最后一个的所有子视图的布局文件的资源标识

public ResourceCursorTreeAdapter (Context context, Cursor cursor, int groupLayout, int childLayout)

构造函数。

参数

context 和正在运行的SimpleListItemFactory关联的ListView的上下文

cursor 数据库游标

groupLayout 为所有组定义了视图布局文件的资源标识

expandedGroupLayout 定义了展开组的视图布局文件的资源标识

childLayout 定义了除了最后一个的所有子视图的布局文件的资源标识

公共方法

protected abstract View newChildView (Context context, Cursor cursor, boolean isLastChild, ViewGroup parent)

创建一个新的子元素视图并持有指向数据的游标cursor

参数

context 应用程序上下文对象

cursor 获取数据的游标对象,它已经移动到正确的位置

IsLastChild子元素是否处于组中的最后一个

parent新视图(View)所依附于的父对象。

返回值

新创建的视图

protected abstract View newGroupView (Context context, Cursor cursor, boolean isExpanded, ViewGroup parent)

创建一个新的组视图并持有组中指向数据的游标cursor

参数

context 应用程序上下文对象

cursor 获取数据的游标对象,它已经移动到正确的位置

isExpanded 该组是否展开状态

parent新视图(View)所依附于的父对象。

返回值

     新创建的视图

更多相关文章

  1. Android(安卓)Studio(十):添加assets目录
  2. Android(安卓)Studio(九):引用jar及so文件
  3. android ndk Hello World
  4. Android读取xxx.properties配置文件中文出现乱码解决方法
  5. android studio 项目的版本问题
  6. android常用adb命令
  7. Android(安卓)中文 API(123) —— AbsListView
  8. Android(安卓)拍照 录音 拍视频 旋转 裁剪 压缩图片
  9. NPM 和webpack 的基础使用

随机推荐

  1. Android复制Assets目录下的文件到指定目
  2. "0x0055cde3"指令引用的内存"0x0000ffff"
  3. Android Studio升级至3.0所遇到的问题
  4. Android Uri如何在intent中传输
  5. Android Bitmap对象与byte[]相互转换
  6. Android下的RTSP客户端搭建
  7. Android类参考---Fragment(一)
  8. 重大福利!!!《阿里巴巴Android开发手册》首
  9. Android的Broadcast应用说明一例
  10. 如何用adb命令启动你的Android程序