ExpandableListView, how to hide indicator

If you use an ExpandableListView and want to hide the group indicator (that arrow that appears on the left) you need to put this in your xml file where the ExpandableListView is created:

android:groupIndicator="@null"

Below is a complete example of an xml file:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
        >
    <ExpandableListView android:id="@+id/expandable_list"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:groupIndicator="@null"
                        android:cacheColorHint="#00000000"
                        android:listSelector="@android:color/transparent"/>
</LinearLayout>

For more info about groupIndicator from Android’s ExpandableListView, visit the official documentation here.

keyboard_arrow_up
sponsored
Exit mobile version