Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing action bar searchview hint text color

How can I change the action bar search view hint text colour?

This question explains how to get the EditText when using ABS: Android ActionBar Customize Search View

Is there a android.R.id I could use to get a reference to the EditText so I could change the hint colour? Or is there some other way to change the colour?

Action bar search view hint text

like image 272
Juhani Avatar asked Jul 22 '13 15:07

Juhani


People also ask

How do I set text in Searchview?

You can use setQuery() to change the text in the textbox. However, setQuery() method triggers the focus state of a search view, so a keyboard will show on the screen after this method has been invoked. To fix this problem, just call searchView.

How do I put the search bar on my Android toolbar?

To add a SearchView widget to the app bar, create a file named res/menu/options_menu. xml in your project and add the following code to the file. This code defines how to create the search item, such as the icon to use and the title of the item.


1 Answers

android:actionBarWidgetTheme of your main theme should point to a style that has a android:textColorHint in it. That one will allow changing the hint text color of the search view.

like image 114
Kirill Avatar answered Oct 08 '22 19:10

Kirill