I want to customize back and clear icon in SearchView when it collapses. My requirement is to change the color to white but now it is black.(Please refer the image shared below). I am looking to fix this issue for a couple of days, but none of the solution which I tried had not worked out. I tried few of the solutions suggested from SO like as follows:
Solution 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>
Solution 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);
My project 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>
Screenshot of My exact problem:
Kindly please help me to resolve my issue. Any kind of solutions and suggestions would be much helpful for me. Thanks for your support.