Android: Hide child dividers in ExpandableListView

前端 未结 6 1041
轻奢々
轻奢々 2020-12-24 11:25

I need to completely remove dividers from ExpandableListView. As for parent items it\'s a setDividerHeight method where I can pass a zero value. But there\'s no similar meth

6条回答
  •  心在旅途
    2020-12-24 11:45

    If you want to remove child divider only, You can create a drawable with same color as of child background color. Then set it as your child divider.

    ShapeDrawable sd1 = new ShapeDrawable(new RectShape()); sd1.getPaint().setColor(YOUR CHILD ITEM BACKGROUND COLOR); mExpListView.setChildDivider(sd1);

提交回复
热议问题