I am using the default ActionBar
in my android project. I am using the Theme.AppCompat.Light.DarkActionBar
theme.
I have created XML
file for menu
and the search item
from this menu
is below:
<item
android:id="@+id/search_button"
android:icon="@android:drawable/ic_menu_search"
android:title="Search"
app:showAsAction="always" />
When i load the application on physical device for testing the color of the search icon
is not white, its a kind of reddish (the low color of the ActionBar
), see the image below:
Title color is white which is OK, overflow menu button color is white which is OK, but the search icon button is not white. So, i did research and found the following sources in which no one is working.
- How to change searchview icon color?
- How can i change the icon color of searchview in actionbar?
- how to change the icon color of search view?
- Change the text colors and icons of searchview in action bar.
- And all these .....
Eventually, i realize that there is no way to change the color of the default search icon in the ActionBar
. I just want to make this question to be the last and long explanation of this issue which covers the Why the icon color is different then the title color and overflow menu icon color?
, Why this thing is impossible to solve?
, Where this color property of xml for search icon is hidden that is hard to find?
and How(if possible) to change the color of this default search icon in the ActionBar
? I know we can add the custom icon with white color here and we also have the ToolBar
, but i don't want this solution because if its possible to change the title in ActionBar
, add the overflow menu options into the ActionBar
(etc) then it should also be possible to change the color of the search icon in the ActionBar
. May be i found a hidden geek who knows this issue and can explain the Why
and What
to make this question the last informative/solution for future android folks.
If anyone want to negative mark my question, i am happily ready for this but at least this question will be helpful for the future android newbies. Thanks!!!