I want to change the color of navigation drawer icon(3 vertical bars) from white to grey. How do i do this in the simplest way?
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="@color/grey"
local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
local:popupTheme="@style/ThemeOverlay.AppCompat.Light" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Toolbar Title"
android:id="@+id/toolbar_title"
android:textColor="#010101" />
<!--android:layout_gravity="center"-->
</android.support.v7.widget.Toolbar>
You can change the icon itself programmatically, using something like this:
toolbar.setNavigationIcon(R.drawable.new_icon);
Get the drawable
Drawable icMenu = ContextCompat.getDrawable(this, R.drawable.ic_hamburguer);
Tint the drawable
icMenu.setColorFilter(getResources().getColor(android.R.color.darker_gray), PorterDuff.Mode.SRC_ATOP);
Use it with the actionBar
actionBar.setHomeAsUpIndicator(icMenu);
actionBar.setDisplayHomeAsUpEnabled(true);
Or the toolbar
toolbar.setNavigationIcon(icMenu);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With