有俩种方法 :
一种是在drawable文件夹下新建xml文件:test.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:state_expanded="true"android:drawable="@drawable/图1" />
<item android:state_expanded="falsetrue"drawable="@drawable/图2" />
</selector>
将ExpandableListView 的setGroupIndicator属性设为:.setGroupIndicator(this.getResources().getDrawable(R.drawable.test));
另一种是重写BaseExpandableListAdapter
在getGroupView里根据isExpanded手动设置图标