If i have a expandablelistview with custom layout (group.xml and child.xml), the are any way to set a 9.png background for all the row(group + child? if is expand, only row if collapse).
For example i have 4 groups
1row collapsed with background
2row collapsed with backgound
3row expand
group <---- I want to use 1 background for group.xml and child.xml, this is it, the group background expands to be background for child too
child
5row collapsed with backgruond
Or, when i use expandablelistview, and define a row.xml background, when i expand a groupo, the background envolpes too to the child?
I am afraid this is not possible. Since you are referring to two different resource files in a ExpandableList, you can’t group them as a single view. Being this the case, you can set the 9 patch to your total expandable listview which you might not want as your need. So here goes the round about method.
1)You can have three set of images. Once full closed image. second image can look like the top half of the first image and third image to look like the bottom half of the first image.
2)Add the listener on GroupExapnded() to your ExpandableListView. Now this will return you the position of the view, boolean flag of the view state(whether it is expanded or collapsed) and and the object to that view.
3)Now based on the boolean flag you have to play around with the images as of which image is to be as the background.
There will be two scenarios,
1)For the expanded state, you have to apply the second image to the group and the third image to the child.
2)If the group is collapsed , you have to apply the first image as the background to the Group View.
This is the most ugliest way which I know by myself. if you can get any better solution kindly inform me to.