![](/img/trans.png)
[英]Android - ExpandableListView change background for child items
[英]Change Background Color of Clicked Child in ExpandableListView
我想更改在ExpandableListView中單擊的孩子的背景顏色。 也就是說,單擊任何一個孩子時,它的背景色都應該更改。
采用
listView.setOnChildClickListener(new OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, long id) {
// TODO Auto-generated method stub
return false;
}
});
**編輯**
final String selected = (String) yourAdapter.getChild(
groupPosition, childPosition);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.