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?
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With