I want to put divider only between parent elements. When i set
android:divider="@drawable/divider"
android creates divider between parent elements, but creates divider between child elements too. When i add android:childDivider="@color/transparent"
android removes the divider between child elements, but the free space between them remains. Why? I have tried to android:dividerHeight="0dp"
but nothing happened. At all i want to set divider between parent elements, but i do not want any divider or empty space between child elements.
any ideas how to do that??
In order to remove dividers just from the child views and not between the parents in the expandable list:
add android:childDivider="#00000000"
in the ExapandableListView
attributes in XML:
<ExpandableListView android:id="@+id/elv" android:layout_width="match_parent" android:layout_height="wrap_content" android:childDivider="#00000000" />
Refer this page for more information
Give Divider color and its height (dividers will be visible when groups are collapsed)
<ExpandableListView android:id="@+id/list" android:layout_width="match_parent" android:layout_height="wrap_content" android:divider="@color/color_black" android:dividerHeight="1dp" android:groupIndicator="@null" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With