How can I change separator color in NavigationView?

just apply following line on style.xml

<item name="android:listDivider">your_color</item>

The below is just information for your knowledge …
If you have seen design support library .. they are using following layout for NavigationView seprator..

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
             android:layout_width="match_parent"
             android:layout_height="wrap_content">

    <View android:layout_width="match_parent"
          android:layout_height="1dp"
          android:background="?android:attr/listDivider"/>

</FrameLayout>

here, you can see android:background=”?android:attr/listDivider” ..
So enjoy …
and here is my output that i change color to holo_blue
enter image description here

Leave a Comment