Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the search suggestions Text Color

Tags:

android

search

I want it to be in black. I tried to change the textPrimaryColor but the search input field was also affected and I don't want that to happen.

Screenshot

Here's my styles for the Action Bar.

<style name="MyActionBar" parent="Theme.AppCompat.Light">
    <item name="android:textColorPrimary">@android:color/white</item>
    <item name="android:textColorPrimaryInverse">@android:color/white</item>
    <item name="android:textColorHint">@android:color/white</item>
    <item name="android:actionMenuTextColor">@android:color/white</item>
    <item name="android:textColorSecondary">@android:color/white</item>
</style>
like image 833
Dark Avatar asked Jan 31 '15 02:01

Dark


1 Answers

I had the same problem and found the solution here: https://code.google.com/p/android/issues/detail?id=5237#c8

EDIT:

Try to override the style for the suggested text.

In your "MyActionBar" style add the following item:

<item name="android:autoCompleteTextViewStyle">@style/AutoCompleteTextViewLight</item>

And create the style AutoCompleteTextViewLight which fix the color:

<style name="AutoCompleteTextViewLight" parent="@android:style/Widget.AutoCompleteTextView">
    <item name="android:textColor">@android:color/primary_text_light</item>
</style>
like image 76
ljmelgui Avatar answered Sep 28 '22 22:09

ljmelgui