Is it possible to change the textcolor on an Android SearchView?

CACuzcatlan picture CACuzcatlan · Jul 4, 2012 · Viewed 79.1k times · Source

The SearchView element doesn't have any properties for changing the text color. The default text color is black and doesn't work on our dark background. Is there a way to change the color of the text without resorting to hacks?

I found this similar question related to changing the text size, but so far, it doesn't have any answers: How to set SearchView TextSize?

Answer

akdotcom picture akdotcom · Nov 12, 2014

Add

<item name="android:editTextColor">@android:color/white</item>

to the parent theme and that should change the entered text. You can also use

<item name="android:textColorHint">@android:color/white</item>

to change the hint text for the SearchView. (Note that you can replace the @android:color/white with whatever appropriate value you're hoping to use)