I could not change the color of back button. I am using toolbar material design. In my app I am applying black background of tool bar but the back design is being black by d
Use this:
<style name="BaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorControlNormal">@color/white</item>
</style>
Here is the simplest way of achieving Light and Dark Theme for Toolbar.You have to change the value of app:theme
of the Toolbar tag
app:theme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat"
I am using <style name="BaseTheme" parent="Theme.AppCompat.Light.NoActionBar>
theme in my android application and in NoActionBar theme, colorControlNormal
property is used to change the color of navigation icon default Back button arrow in my toolbar
styles.xml
<style name="BaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorControlNormal">@color/your_color</item>
</style>
To style the Toolbar on Android 21+ it's a bit different.
<style name="DarkTheme.v21" parent="DarkTheme.v19">
<!-- toolbar background color -->
<item name="android:navigationBarColor">@color/color_primary_blue_dark</item>
<!-- toolbar back button color -->
<item name="toolbarNavigationButtonStyle">@style/Toolbar.Button.Navigation.Tinted</item>
</style>
<style name="Toolbar.Button.Navigation.Tinted" parent="Widget.AppCompat.Toolbar.Button.Navigation">
<item name="tint">@color/color_white</item>
</style>
You don't have to change style for it. After setting up your toolbar as actionbar, You can code like this
android.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
android.getSupportActionBar().setHomeAsUpIndicator(R.drawable.back);
//here back is your drawable image
But You cannot change color of back arrow by this method