[Solved] How to i can change android navigation view item with underline color


Take Group For you want to underline below

LIKE THAT

 <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<group android:id="@+id/grp1" android:checkableBehavior="single">

    <item
        android:id="@+id/FIRST"
        android:icon="@drawable/FIRST"
        android:title="FIRST" />
    </group>

   //tHIS sHOWING uNDERLINE bELOW
<group android:id="@+id/grp2"  android:checkableBehavior="single">
    <item
        android:id="@+id/SECOND"
        android:icon="@drawable/SECOND"
        android:title="SECOND" />
    </group>
   //tHIS sHOWING uNDERLINE bELOW
<group android:id="@+id/THIRD"  android:checkableBehavior="single">
    <item
        android:id="@+id/THIRD"
        android:icon="@drawable/THIRD"
        android:title="THIRD" />
    </group>
  //tHIS sHOWING uNDERLINE bELOW
<group android:id="@+id/grp4"  android:checkableBehavior="single">
    <item
        android:id="@+id/FOUR"
        android:icon="@drawable/ic_action_recommended"
        android:title="FOUR" />
    </group>
    //tHIS sHOWING uNDERLINE bELOW

    <item
        android:id="@+id/FIVE"
        android:icon="@drawable/FIVE"
        android:title="FIVE" />
     //tHIS IS nOT sHOWING uNDERLINE bELOW

    <item
        android:id="@+id/SIX"
        android:icon="@drawable/SIX"
        android:title="SIX" />

  //tHIS IS nOT sHOWING uNDERLINE bELOW
<group android:id="@+id/grp5"  android:checkableBehavior="single">
    <item
        android:id="@+id/SEVEN"
        android:icon="@drawable/SEVEN"
        android:title="SEVEN" />
    </group>

  //tHIS sHOWING uNDERLINE bELOW
   </menu>

Do this For Color of line

in your xml set theme to navigationView

<android.support.design.widget.NavigationView
android:background="@color/profileBackground"
app:itemTextColor="@android:color/white"
app:itemIconTint="@android:color/white"
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
android:theme="@style/NavigationView" />

take in your style.xml

   <style name="NavigationView" parent="ThemeToolbar.NavigationView" >
    <item name="android:listDivider">@color/yourcolor</item>
    <item name="android:textColorSecondary">@color/yourcolor</item>
</style>

2

solved How to i can change android navigation view item with underline color