How to change Menu SearchView Widget Icon Color In Android
SearchView Widget in Android is used to search a query and submit a request to a search provider, Which shows the suggestions list on the basis of the search query.
Visit my website at https://danishamjad.com/
Recently I have been working in an android application in which
SearchView Widget used in the
menu.xml file. You can see the code from the below gist.
The menu file is used in the toolbar & I noticed that the menu
searchView icon is showing the right color in below Oreo and showing the wrong icon color in android Oreo.
This will occurs when you don’t define the theme in your toolbar, After a lot of research, I noticed that the theme of the toolbar is not defined.
How to solve this:
To solve this issue you just need to add a toolbar style in your
style.xml file like below:
Now define your style in your toolbar app: theme like below:
That’s it now you will be able to see the
SearchView widget icon color as you defined in your
If you want to learn some other topic then check the below link:
Sharing the Knowledge is Caring :-)
Thanks for reading this article. Be sure to clap to recommend this article if you found it helpful. It means a lot to me.