修改ExpandableListView前面展开小图标

 
1、需要写一个selector的xml文件
[html]  view plain copy
 
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <selector xmlns:android="http://schemas.android.com/apk/res/android">  
  3.     <item android:state_expanded="true" android:drawable="@drawable/select_button"></item>  
  4.     <item android:drawable="@drawable/select_button_down"></item>  
  5. </selector>  
这里state_expanded="true"指是展开状态的图片

然后再Activity中加入代码

[java]  view plain copy
 
  1. expLV = (ExpandableListView) mLayout.findViewById(R.id.ExpandableListView_Section);  
  2.         expLV.setGroupIndicator(this.getResources().getDrawable(R.drawable.group_icon_selector));  

注意这里面图片是会被拉伸的

所以需要制作成9.png格式的图片

猜你喜欢

转载自lishuaishuai.iteye.com/blog/1840197