根据我想要的 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>
在我的 list 中,我将应用程序主题设置为浅色,并将一些 Activity 的属性主题设置为深色。
我发现我的工具栏有奇怪的行为。假设我在一个带有白色工具栏的 Activity 中(该 Activity 使用浅色主题)并且我导航到一个带有红色工具栏(具有深色主题)的 Activity 。当我回到带有白色工具栏的 Activity 时,导航图标(向左的箭头)现在是白色的。就像它带走了我的黑暗主题。
希望我把情况解释清楚。
谢谢!
最佳答案
编辑 已在支持库 v22.0.0 中修复
最后,我发现这是 appCompat 中的一个错误。它是固定的,但仍未合并/发布。
关于android - Toolbar NavigationIcon 宽松主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26808917/