I want to use a custom image in place of the default icon used to toggle the navigation drawer in android. How do I go about it? Here is an image of what I want to change.
Use below code to set your custom ActionBar toggle button.
mDrawerToggle.setDrawerIndicatorEnabled(false);
// mDrawerToggle.setHomeAsUpIndicator(R.drawable.menu_icon);
mToolbar.setNavigationIcon(R.drawable.menu_icon);
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mDrawerLayout.openDrawer(Gravity.LEFT);
}
});
you can change with style.xml
<style
name="BaseTheme" parent="Theme.AppCompat.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="homeAsUpIndicator">@drawable/menu</item>
<item name="android:textColorPrimary">@android:color/white</item>
</style>
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