Navigation Drawer - Change menu color

Asked

Viewed 695 times

1

Hello, I am implementing a navigation Drawer in my android application and for a design question I would like to know how to change the background color of activity_home_drawer, where the menu items are?

  • What did you try?

1 answer

1

goes in the xml of its main Activity!

   design.widget.NavigationView


    android:id="@+id/nav_view"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    app:theme="@style/NavigationDrawerStyle"
    app:itemTextColor="#f8f7fc"
    android:layout_gravity="start"
    android:fitsSystemWindows="true"
    android:background="#7CFC00" (aqui muda o cor)
    app:itemIconTint="#f8f7fc"
    app:headerLayout="@layout/nav_header_main"
    app:menu="@menu/main_drawer"/>
  • The < at the beginning of the NavigationView ?

  • Yes. But this is to remind you which part of the code should be applied to color change.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.