Android - ExpandableListView change background for child items

Posted by DroidIn.net on Stack Overflow See other posts from Stack Overflow or by DroidIn.net
Published on 2009-12-14T21:39:17Z Indexed on 2010/04/06 3:03 UTC
Read the original article Hit count: 1070

I'm using ExpandableListView in my app and one of the complains I get from the users is that when the list item is expanded it's hard to visually distinguish where the child item ends and next group item begins. So I would like to change background of the child list item to the different shade. Brutal attempts that I've made so far were based on directly changing background color and text of the elements inside the child view item but that leads to loss of hovers and highlights. So my question is - what is a good strategy to achieve the above? I tried styles and selectors but what really bums me - if I change background for child item then I need to add selectors for all combinations of focus/enabled etc. when all I'm trying to do it to overwrite a single thing.

Is there a way to inherit parent style and set background only for non- focused, enabled child item with other styles retained?

© Stack Overflow or respective owner

Related posts about android

Related posts about expandablelistview