在Android工具栏中更改背面和清除图标的SearchView颜色

我想在SearchView崩溃时自定义后退和清除图标.我的要求是将颜色更改为白色,但现在是黑色.(请参阅下面分享的图像).我希望解决这个问题几天,但我尝试过的解决方案都没有解决.我尝试了几个从SO建议的解决方案,如下所示:

解决方案1:

<style name="AppTheme" parent="@style/Theme.Base.AppCompat.Light.DarkActionBar">
    <item name="actionBarWidgetTheme">@style/YourActionBarWidget</item>
</style>

<style name="YourActionBarWidget" parent="@style/Theme.AppCompat">
    <item name="searchViewCloseIcon">@drawable/xxx</item>
</style>

解决方案2:

final Drawable upArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
upArrow.setColorFilter(getResources().getColor(R.color.WHITE),PorterDuff.Mode.SRC_ATOP);
getSupportActionBar().setHomeAsUpIndicator(upArrow);

我的项目styles.xml

<style name="ToolBarTheme" parent="@style/Theme.AppCompat.Light">
        <item name="colorPrimary">@color/blue</item>
        <item name="colorPrimaryDark">@color/blue</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
        <item name="android:itemTextAppearance">@style/myCustomMenuTextApearance</item>
        <item name="android:actionMenuTextColor">@color/white</item>
        <item name="actionMenuTextColor">@color/white</item>

    </style>



<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
        <item name="spinBars">true</item>
        <item name="color">@color/white</item>
        <item name="gapBetweenBars">2.5dip</item>
        <item name="thickness">2dp</item>
    </style>

我的确切问题的屏幕截图:

请帮我解决我的问题.任何类型的解决方案和建议对我都有帮助.感谢您的支持.

解决方法

如果您在工具栏上搜索白色图标
在工具栏标签添加这些
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...