【问题标题】:Toolbar NavigationIcon loose theme工具栏 NavigationIcon 松散主题
【发布时间】:2015-01-04 16:44:45
【问题描述】:

根据我想要的 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>

在我的清单中,我将应用程序主题设置为浅色,一些活动将属性主题设置为深色。

我发现我的工具栏出现了奇怪的行为。假设我在一个带有白色工具栏(该活动使用浅色主题)的活动中,并且我导航到一个带有红色工具栏(具有深色主题)的活动。当我回到带有白色工具栏的活动时,导航图标(左箭头)现在是白色的。就像它占据了我的黑暗主题一样。

希望我能清楚地说明情况。

谢谢!

【问题讨论】:

    标签: android android-toolbar


    【解决方案1】:

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-25
      相关资源
      最近更新 更多