1、需要写一个selector的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/select_button"></item> <item android:drawable="@drawable/select_button_down"></item> </selector>这里state_expanded="true"指是展开状态的图片
然后再Activity中加入代码
expLV = (ExpandableListView) mLayout.findViewById(R.id.ExpandableListView_Section); expLV.setGroupIndicator(this.getResources().getDrawable(R.drawable.group_icon_selector));
注意这里面图片是会被拉伸的
所以需要制作成9.png格式的图片