Android 3.1 r1 中文API文档 (121) —— ResourceCursorTreeAdapter
结构 继承关系 public abstract classtResourceCursorTreeAdapterextendsCursorTreeAdapter java.lang.Object android.widget.BaseExpandableListAdapter android.widget.CursorTreeAdapter android.widget.ResourceCursorTreeAdapter 直接子类 SimpleCursorTreeAdapter 类概述 一个简单的可扩展的ExpandableListAdapter,通过在XML文件来创建views。你可以指定一个定义了views外观的XML文件。 构造函数 publicResourceCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, int expandedGroupLayout, int childLayout, int lastChildLayout) 构造函数。 参数 context和正在运行的SimpleListItemFactory关联的ListView的上下文 cursor数据库游标 collapsedGroupLayout定义了收缩组的视图布局文件的资源标识 expandedGroupLayout定义了展开组的视图布局文件的资源标识 childLayout定义了除了最后一个的所有子视图的布局文件的资源标识 lastChildLayout定义了一组中最后一个子视图的布局文件的资源标识 publicResourceCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, int expandedGroupLayout, int childLayout) 构造函数。 参数 context和正在运行的SimpleListItemFactory关联的ListView的上下文 cursor数据库游标 collapsedGroupLayout定义了收缩组的视图布局文件的资源标识 expandedGroupLayout定义了展开组的视图布局文件的资源标识 childLayout定义了除了最后一个的所有子视图的布局文件的资源标识 publicResourceCursorTreeAdapter(Context context, Cursor cursor, int groupLayout, int childLayout) 构造函数。 参数 context和正在运行的SimpleListItemFactory关联的ListView的上下文 cursor数据库游标 groupLayout为所有组定义了视图布局文件的资源标识 expandedGroupLayout 定义了展开组的视图布局文件的资源标识 childLayout定义了除了最后一个的所有子视图的布局文件的资源标识 公共方法 protected abstract ViewnewChildView(Context context, Cursor cursor, booleanisLastChild, ViewGroup parent) 创建一个新的子元素视图并持有指向数据的游标cursor。 参数 context应用程序上下文对象 cursor获取数据的游标对象,它已经移动到正确的位置 IsLastChild子元素是否处于组中的最后一个 parent新视图(View)所依附于的父对象。 返回值 新创建的视图 protected abstract ViewnewGroupView(Context context, Cursor cursor, booleanisExpanded, ViewGroup parent) 创建一个新的组视图并持有组中指向数据的游标cursor。 参数 context应用程序上下文对象 cursor获取数据的游标对象,它已经移动到正确的位置 isExpanded该组是否展开状态 parent新视图(View)所依附于的父对象。 返回值 新创建的视图 本文转自over140 51CTO博客,原文链接:http://blog.51cto.com/over140/582335,如需转载请自行联系原作者