【发布时间】:2012-01-15 18:10:24
【问题描述】:
我将 ExpandableListView 与 SimpleCursorTreeAdapter 一起使用。是否可以在bindChildView方法中获取当前孩子所属的组号?
谢谢!
【问题讨论】:
标签: android expandablelistview
我将 ExpandableListView 与 SimpleCursorTreeAdapter 一起使用。是否可以在bindChildView方法中获取当前孩子所属的组号?
谢谢!
【问题讨论】:
标签: android expandablelistview
我尝试了另一种使用 getChildView 获取组和子位置的方法:
@Override
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
ImageButton ib=null;
View v = super.getChildView(groupPosition, childPosition,isLastChild, convertView, parent);
ib=(ImageButton)v.findViewById(R.id.delete);
ib.setTag(R.id.TAG_GROUPPOS, groupPosition);
ib.setTag(R.id.TAG_CHILDPOS, childPosition);
return v;
}
【讨论】: