Android Appcompat工具栏';s后退按钮和选项按钮为黑色

Android Appcompat工具栏';s后退按钮和选项按钮为黑色,android,xml,button,toolbar,Android,Xml,Button,Toolbar,在我们的应用程序中,我们使用的是新的工具栏,而不是旧的actionbar 在安卓5及更高版本上,一切正常。在Android 4及更低版本上,后退按钮和选项按钮显示为黑色 而它们应该是白色的 我们的themes.xml定义如下: <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:windowNoTitle">true</item>

在我们的应用程序中,我们使用的是新的工具栏,而不是旧的actionbar

在安卓5及更高版本上,一切正常。在Android 4及更低版本上,后退按钮和选项按钮显示为黑色

而它们应该是白色的

我们的themes.xml定义如下:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="popupTheme">@style/ThemeOverlay.AppCompat.Light</item>
    <item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item>

    <item name="colorPrimary">@color/ColorPrimary</item>
    <item name="colorPrimaryDark">@color/ColorPrimaryDarker</item>
    <item name="colorAccent">@color/ColorPrimaryRipple</item>
</style>

<!-- AppCompat Theme Transparent -->
<style name="Theme.Translucent" parent="AppTheme">
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowBackground">@color/club_nestle_description_activity_background</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:colorBackgroundCacheHint">@null</item>
</style>

真的
假的
@style/ThemeOverlay.AppCompat.Light
@android:彩色/透明
@颜色/原色
@颜色/原色较深
@颜色/原色波纹
真的
@颜色/俱乐部\雀巢\说明\活动\背景
@空的
真的
@空的

工具栏:

<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/ColorPrimary"
    android:elevation="4dp"
    android:minHeight="?attr/actionBarSize"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />


任何帮助都将不胜感激

试试这个。为
工具栏创建自定义主题

<style name="MyToolbarStyle" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
    <item name="colorControlNormal">@android:color/white</item>
    <item name="android:textColorPrimary">@android:color/white</item>
</style>
有关更多信息,请参阅


希望它有帮助

尝试将此应用于您的
AppTheme
样式:

<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">

我找到了解决方案:我的gradle文件缺少以下行:

android {  
   defaultConfig {  
     generatedDensities = []  
  }  

  // This is handled for you by the 2.0+ Gradle Plugin  
  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }  
 } 

请尝试在您的
AppTheme
这行
@android:color/white
中添加,谢谢,但我仍然有问题
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
android {  
   defaultConfig {  
     generatedDensities = []  
  }  

  // This is handled for you by the 2.0+ Gradle Plugin  
  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }  
 }