您的位置:首页 > 其它

茴香豆的第五种写法---设置ExpandableListView系统自带图标按下效果

2013-09-16 22:47 513 查看
1 编写groupindicator_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/right" />   
    <item android:drawable="@drawable/down" />   
</selector>

再次指定ExpandableListView展开和收缩时的不同图标



2 在布局文件中为<ExpandableListView指定groupIndicator

<ExpandableListView
        android:id="@+id/expandableListView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:groupIndicator="@drawable/groupindicator_selector"
    />
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐