Search code examples
androidexpandablelistviewindicator

android:set size of indicator in expandable list view


I am making an app in which i have to use image of group indicator when when applied it shows enlargrd image .Can anyone help me how to set indicator image in expandable list view .Any help will be appreciated.


Solution

  • a custom drawable is probably what you need. You cant toy with the in built indicator. have a look at this. The group_indicator.xml at the bottom of that page is an example of a custom indicator. You just add this drawable to the android:groupindicator value of you expandablelistview element. This way you can control the indicator behavious and size and with aa few tweaks also hide the indicator if there are no children in the group.

        <selector xmlns:android="http://schemas.android.com/apk/res/android">  
            <item android:state_empty="true" android:drawable="@drawable/arrowright">  
            <item android:state_expanded="true" android:drawable="@drawable/arrowdown">  
            <item android:drawable="@drawable/arrowright">  
            </item></item></item>  
        </selector>  
    

    Hope it helps.