前言java
本章內容是android.widget.ResourceCursorTreeAdapter,版本爲Android 3.1 r1,爲Android 3.0 r1新增API,翻譯來自"xiaoQLu",歡迎訪問它的博客:"http://www.cnblogs.com/xiaoQLu",再次感謝"xiaoQLu" !期待你一塊兒參與Android API的翻譯,聯繫我over140@gmail.com。
android
聲明數據庫
歡迎轉載,但請保留文章原始出處:)
ide
農民伯伯:http://over140.blog.51cto.com/函數
Android中文翻譯組:http://goo.gl/6vJQl
佈局
結構spa
繼承關係翻譯
public abstract classt ResourceCursorTreeAdapter extends CursorTreeAdapter對象
java.lang.Objectblog
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)所依附於的父對象。
返回值
新建立的視圖