Android how to style a SearchView in Actionbar

androidandroid-actionbar

I need to change the style of my SearchView in my ActionBar. In particular I need to change the text hint color and the SearchView icons if possible. How can I accomplish this in XML (is it even possible in XML)?

If this isn't possible, how can I easily recreate similar behavior with a custom view? The close/expand behavior of the SearchView is particularly useful for me.

Best Answer

Have you tried something like this (With ActionBarSherlock):

AutoCompleteTextView searchText = (AutoCompleteTextView) searchView.findViewById(R.id.abs__search_src_text);
searchText.setHintTextColor(getResources().getColor(R.color.white));
searchText.setTextColor(getResources().getColor(R.color.white));

It works fine for me.