This is my menu.xml
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_search"
android:icon="@drawable/search_icon"
android:title="@string/action_search"
app:actionViewClass="android.widget.SearchView"
app:showAsAction="always" />
<item
android:id="@+id/action_favorite"
android:icon="@drawable/favorite_icon"
android:title="@string/action_favorite"
app:showAsAction="always" />
<item
android:id="@+id/themes"
android:title="@string/overflow_menu_item"
app:showAsAction="never">
<menu>
<item
android:id="@+id/background1"
android:title="Red-PinkGradient"
/>
<item
android:id="@+id/background2"
android:title="Red-Gradient"
/>
<item
android:id="@+id/background3"
android:title="Green-Gradient"
/>
<item
android:id="@+id/background4"
android:title="Black-GreyGradient"
/>
</menu>
</item>
<item
android:title="@string/overflow_menu_item2"
android:id="@+id/settings"
/>
And this is my styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionOverflowButtonStyle">@style/overFlow</item>
<item name="searchViewStyle">@style/CustomSearchViewStyle</item>
</style>
<style name="overFlow" parent="@style/Widget.AppCompat.Light.ActionButton.Overflow">
<item name="android:src">@drawable/ic_overflow_icon</item>
</style>
<style name="CustomSearchViewStyle" parent="Widget.AppCompat.SearchView">
<item name="queryBackground">@color/white</item>
<item name="searchIcon">@drawable/search_icon</item>
</style>
How can i change the icon color of my searchview? I tried to set the icon in my item to the drawable which is a white search icon, but i stays black. https://imgur.com/a/LCRzt (this is what i have now, but the search icon needs to be white) https://imgur.com/a/Q65lS (what is want as result)
I want the color to be white, for the other icons it works, but not for my searchview.
A second problem is when i click the search icon, my overflow disappears which is what i want, but my favorite icon stays there, how can i make it disappear? And how can i make the close button also white, the small x icon to close the searchView. https://imgur.com/a/3EBa4 (what i have now) https://imgur.com/a/CbvqR (what i want) How can i solve this?
Thanks in advance, -Vince