工具栏NavigationIcon松散主题

Mat*_*hbl 6 android android-toolbar

我根据我想要的actionBar颜色(深色或浅色)为我的应用程序使用两个主题: - Theme.AppCompat.Light.NoActionBar - Theme.AppCompat.NoActionBar

这是我的工具栏布局:

<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:minHeight="?attr/actionBarSize"
    app:theme="@style/ThemeOverlay.AppCompat.ActionBar"
    >

    <TextView
        android:id="@+id/toolbar_title"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:maxLines="1"
        android:ellipsize="end"
        android:textAppearance="?android:attr/textAppearanceLarge"
        />

</android.support.v7.widget.Toolbar>
Run Code Online (Sandbox Code Playgroud)

在我的清单中,我将Application主题设置为light,一些活动将属性主题设置为dark.

我看到我的工具栏有一种奇怪的行为.假设我正在使用白色工具栏进行活动(活动使用灯光主题),然后我导航到带有红色工具栏(具有黑暗主题)的活动.当我使用白色工具栏返回活动时,导航图标(左指向箭头)现在为白色.就像它采取了我的黑暗主题.

希望我能清楚地解释一下情况.

谢谢!

Mat*_*hbl 1

编辑 在支持库 v22.0.0 中修复

最后我发现这是appCompat的一个bug。它已修复,但仍未合并/发布。

https://code.google.com/p/android/issues/detail?id=78289