Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ExpandableListView divider is invisible

I am having the following ExpandableListView:

<ExpandableListView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:id="@+id/listView"
            android:groupIndicator="@android:color/transparent"
            android:background="@color/app_background"
            android:scrollingCache="false"
            android:choiceMode="none"
            android:divider="@color/gray_dark"
            android:dividerHeight="2dp"
            android:childDivider="@color/gray_dark"
            android:cacheColorHint="@color/app_background"/>

The problem that I have is that the expandable list view is not drawing the dividers or at least are not visible.. I am adding a custom view as Group view and also custom list items in my expandable adapter. Could this be a problem?

Does anyone know what can I do to enable the dividers for the list child?

Thank you in advance.

like image 710
Cata Avatar asked Aug 27 '12 15:08

Cata


1 Answers

It seems that I had an issue on my Expandable Adapter.. I was overridden the following method:

@Override
public boolean areAllItemsEnabled() {
    return true;
}

Instead of returning true I left the method to return false and that was the problem... So if anyone has this problem, check that method and make sure it returns true and not false.

Note that it is not necessary to override that method if you extend BaseExpandableListAdapter

like image 156
Cata Avatar answered Oct 29 '22 19:10

Cata