ExpandableListView和getItemViewType

时间:2012-05-02 10:36:24

标签: android expandablelistview expandablelistadapter

ExpandableListAdapter是否支持任何函数作为BaseAdapter重写getItemViewType和getViewTypeCount,我可以在

中创建各种视图类型
getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent)

由于

1 个答案:

答案 0 :(得分:3)

ExpandableListAdapter没有,但它的子类是BaseExpandableListAdapter。因此,间接地,其他子类CursorTreeAdapter,ResourceCursorTreeAdapter,SimpleCursorTreeAdapter和SimpleExpandableListAdapter也是如此。

这些方法是:

    public int getChildType(final int groupPosition, final int childPosition)
    public int getChildTypeCount()