public interface HeterogeneousExpandableList
| android.widget.HeterogeneousExpandableList |
| |
实施时的其他方法使 ExpandableListAdapter利用 Adapter视图类型机制。
一个ExpandableListAdapter声明它有一个视图类型的组项目和一个视图类型的子项目。 尽管适用于大多数ExpandableListView ,但这些值应该针对异构ExpandableListView进行调整。
getGroupView(int, boolean, View, ViewGroup) and
getChildView(int, int, boolean, View, ViewGroup) will be of the appropriate group or child type, resulting in a more efficient reuse of the previously created views.
公共方法(Public methods) |
|
|---|---|
abstract int |
getChildType(int groupPosition, int childPosition) 获取指定子项目将由 |
abstract int |
getChildTypeCount() 返回将由 |
abstract int |
getGroupType(int groupPosition) 获取将由 |
abstract int |
getGroupTypeCount() 返回将由 |
int getChildType (int groupPosition,
int childPosition)
获取将由 getChildView(int, int, boolean, View, ViewGroup)创建的指定子项目的子视图类型。
| 参数(Parameters) | |
|---|---|
groupPosition |
int: the position of the group that the child resides in |
childPosition |
int: the position of the child with respect to other children in the group |
| 返回(Returns) | |
|---|---|
int |
An integer representing the type of child View. Two child views should share the same type if one can be converted to the other in getChildView(int, int, boolean, View, ViewGroup) Note: Integers must be in the range 0 to getChildTypeCount() - 1. IGNORE_ITEM_VIEW_TYPE can also be returned. |
int getChildTypeCount ()
返回将由getChildView(int, int, boolean, View, ViewGroup)创建的子视图类型的数量。 每种类型都代表一组可以在getChildView(int, int, boolean, View, ViewGroup)转换的视图集合。 如果适配器始终为所有子项返回相同类型的视图,则此方法应返回1。
AdapterView.
| 返回(Returns) | |
|---|---|
int |
The total number of types of child Views that will be created by this adapter. |
int getGroupType (int groupPosition)
获取将由getGroupView(int, boolean, View, ViewGroup)创建的组视图类型。 为指定的组项目。
| 参数(Parameters) | |
|---|---|
groupPosition |
int: the position of the group for which the type should be returned. |
| 返回(Returns) | |
|---|---|
int |
An integer representing the type of group View. Two group views should share the same type if one can be converted to the other in getGroupView(int, boolean, View, ViewGroup) . Note: Integers must be in the range 0 to getGroupTypeCount() - 1. IGNORE_ITEM_VIEW_TYPE can also be returned. |
int getGroupTypeCount ()
返回将由getGroupView(int, boolean, View, ViewGroup)创建的组视图类型的数量。 每种类型代表一组可以在getGroupView(int, boolean, View, ViewGroup)转换的getGroupView(int, boolean, View, ViewGroup) 。 如果适配器始终为所有组项目返回相同类型的视图,则此方法应返回1。
AdapterView.
| 返回(Returns) | |
|---|---|
int |
The number of types of group Views that will be created by this adapter. |