ExpandableListView - group indication is stretch to fit the text size

Tomer Mor picture Tomer Mor · Nov 21, 2011 · Viewed 20.1k times · Source

I have group indication with small icon, and i use groupIndicator to call the selector to draw it but I see android by default stretch that icon to fits the text size

how can i prevent that behavior, and display the icon with it's original size ?

Answer

silvermouse picture silvermouse · Aug 29, 2012

group_indicator.9.png

Whatever image you are using as your group indicator, make it a 9 patch (xxx.9.png) image and set its stretchable areas to around the border pixels (which probably may be transparent). It will prevent stretching of image from the middle.