开发者

Can't set ExpandableListView Child DividerHeight

开发者 https://www.devze.com 2023-04-03 12:10 出处:网络
I\'m working with ExpandableListViews, which need to have a divider between groups, but not between the the group and it\'s child.

I'm working with ExpandableListViews, which need to have a divider between groups, but not between the the group and it's child.

I can't find a way to get this done, what I've already tried is:

  1. Set the android:dividerHeight to 0. Result: there is still a space of 1dip between the group and it's child.

  2. If I then try to fill that space with a color or transparency instead of a drawable, it doesn't show, so the gap is still visible. If android:dividerHeight is larger than 0, it shows the 开发者_如何学运维color.

  3. If I set the android:dividerHeight to -1 the gap between the group and it's child dissappears. The divider between the groups obviously also dissappears.

  4. Searching in almost every corner of the web for an easy solution, but it seems that no one has encountered this problem yet.

What I've been thinking of is the following: Remove all dividers add them to the row layouts, however, this would be a lot of extra and imo unneccesary work. And I would have to remove them for each last group.

Does anybody have a clue what I mean and do you have a better solution? Thanks a lot in advance for sharing!

Cheers!

Do


Maybe simpler would be to set the divider color between group and child to the list background color?


You'r nearly there. I'm doing the same. How about this, Set dividerheight to 0px Then create your own divider in the group layout.

0

精彩评论

暂无评论...
验证码 换一张
取 消