Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: ExpandableListView drawable group indicator being big when i using my own icon

I am using this codes to set my own group indicator icon and set it to right side of the list

ExpandableListView list = (ExpandableListView) findViewById(R.id.SCHEDULE);

Drawable icon = StationInfo2.this.getResources().getDrawable(R.drawable.expander_group);

list.setGroupIndicator(icon);

list.setIndicatorBounds(list.getWidth() - 80, list.getWidth() - 40);

Its works to show my own icon but the icon shows in wrong size.

Becouse i am new here i can not post links or image to show how its looks like but i hope someone has a good idea how i can do?

like image 433
RickardP Avatar asked Nov 06 '22 04:11

RickardP


1 Answers

You should draw it using 9-patch. http://developer.android.com/tools/help/draw9patch.html Put black pixel to the corners. that will help. (contact me if you need more info). Look at the origingal one you see black dots? make them for your image. enter image description here

like image 63
s_id Avatar answered Nov 11 '22 09:11

s_id