Android扩展列表项

Android扩展列表项,android,Android,展开时如何更改ExpandableListView中groupItem的颜色? 在可扩展列表适配器中,您有一个名为getGroupView的方法,通过使用该方法您可以做到这一点 public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { //Here you can initialize your view

展开时如何更改ExpandableListView中groupItem的颜色?
在可扩展列表适配器中,您有一个名为getGroupView的方法,通过使用该方法您可以做到这一点

 public View getGroupView(int groupPosition, boolean isExpanded, View convertView,
                ViewGroup parent) {

      //Here you can initialize your view
      if(isExpanded){
        // set color for expanded item.
      }else{
       // set color for non expanded item.
      }
  }