Navigation Drawer customized and colored

4

Hello, what I wanted to do was to be able to put colorful icons in the navigation, how can I do that?

The images I have in my project are colored but in navigation they are only grayish like that. Thanks for the help.

    
asked by anonymous 12.07.2018 / 20:47

2 answers

2

No onCreate() of your ActivityMain puts the code below:

NavigationView navigationView = findViewById(R.id.nav_view); // Aqui com certeza você já faz
// A linha abaixo permite você visualizar os icones com outras cores sem ser a cor padrão
navigationView.setItemIconTintList(null);

You will see the result as soon as you start the application.

    
17.11.2018 / 17:12
1
  • Add the color in your navigation view that is activity_main.xml : app:itemIconTint="@android:color/blue"
  • The default hue is black, but you can use an even darker black tone using # 000000

    <android.support.design.widget.NavigationView
    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"
    app:itemIconTint="#000000"
    app:menu="@menu/activity_main_drawer" />
    

    Translated from

        
    17.08.2018 / 22:00