【发布时间】:2012-06-19 06:34:01
【问题描述】:
我想更改在 ExpandableListView 中单击的子项的背景颜色。 也就是说,当点击任何孩子时,它的背景颜色应该会改变。 我正在尝试以这种方式进行操作,但它选择了其他行,而不是已单击的行。
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
parent.getChildAt(childPosition).setBackgroundColor(Color.DKGRAY);
return false;
}
请告诉我我可能缺少什么。
【问题讨论】:
标签: android background-color expandablelistview