1

I have a toolbar.xml that is included to all activities

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"

android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/ToolBarStyle"
        app:popupTheme="@style/ToolBarStyle">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            android:theme="@style/ToolBarStyle"
            app:popupTheme="@style/ToolBarStyle"
            app:subtitleTextColor="@color/secondaryTextColor"
            app:titleTextAppearance="@style/Toolbar.TitleText"
            app:titleTextColor="@color/primaryTextColor" />
        </android.support.design.widget.AppBarLayout>

    <View
        android:id="@+id/toolbar_shadow"
        android:layout_width="match_parent"
        android:layout_height="4dp"
        android:background="@drawable/toolbar_drops_shadow" />
</LinearLayout>

On one of my activities I have back arrow and by default it's dark grey. I'd like to make it white. For this I create a theme

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/primaryColor</item>
    <item name="colorPrimaryDark">@color/primaryDarkColor</item>
    <item name="colorAccent">@color/secondaryColor</item>
    <item name="android:textColorHint">@color/hintTextColor</item>
</style>
<!-- ToolBar -->
<style name="ToolBarStyle" parent="Widget.AppCompat.Toolbar">
    <item name="android:gravity">center</item>
    <item name="colorControlNormal">#FFF</item>
</style>

The problem is that this theme is not applied in KitKat to my toolbar. If I put <item name="colorControlNormal">#FFF</item> to AppTheme back arrow, menu icon become white. The problem is that it makes white some tints of EditText, everywhere.

Do you have an idea why this one does not work and how I can correctly apply a theme to the toolbar?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Vitalii
  • 10,091
  • 18
  • 83
  • 151
  • I'm not sure why that's not working on specifically KitKat, but you can tint the navigation icon directly, instead of using the theme on the `Toolbar`: https://stackoverflow.com/questions/45920970/tint-navigation-icon-in-toolbar. – Mike M. Oct 27 '17 at 06:02

0 Answers0