6

I am using sherlock action bar Version 4.1.0 (2012-05-17). How can I change the color of the text color in this screenshot ? On the actual device it is barelly readable

enter image description here

i have this theme

<style name="MyTheme" parent="@style/Theme.Sherlock.Light">
    <item name="android:textSize">20dp</item> 
</style>

And this in AndroidManifest.xml

<application
        android:name="abc.MyApp"
        android:icon="@drawable/ic_launcher"
        android:logo="@drawable/logo"
        android:label="@string/app_name"
        android:theme="@style/MyTheme" 
        >
max4ever
  • 11,909
  • 13
  • 77
  • 115

4 Answers4

3

Actually i've managed to style the SearchView text color in abs 4.2 by doing the following:

<style name="MyTheme" parent="Theme.Sherlock.Light">

    <item name="searchAutoCompleteTextView">@style/Widget.Styled.SearchAutocompleteTextView</item>

    <item name="queryHint">@string/Search</item>
    <item name="android:queryHint">@string/Search</item>


</style>

<style name="Widget.Styled.SearchAutocompleteTextView" parent="Widget.Sherlock.Light.SearchAutoCompleteTextView">
    <item name="android:textColor">YOU_COLOR_HERE</item>

</style>
forcewill
  • 1,637
  • 2
  • 16
  • 31
1

I don't have any experience with Sherlock, but did you try adding:

<item name="android:textColor">@color/my_color</item>

to the Sherlock action bar theme?

And then in your values/color.xml you have the color:

<color name="my_color">#ff00ff00</color>
Andy Res
  • 15,963
  • 5
  • 60
  • 96
1

thanks to this Answer To: Changing the background drawable of the searchview widget

SearchManager searchManager = (SearchManager) a.getSystemService(Context.SEARCH_SERVICE);
SearchView searchView = new android.widget.SearchView(a.getApplicationContext());
int searchPlateId = searchView.getContext().getResources().getIdentifier("android:id/search_src_text", null, null);
// Getting the 'search_plate' LinearLayout.
AutoCompleteTextView searchPlate = (AutoCompleteTextView) searchView.findViewById(searchPlateId);
// Setting background of 'search_plate' to earlier defined drawable.
searchPlate.setTextColor(Color.BLACK);
...
Community
  • 1
  • 1
max4ever
  • 11,909
  • 13
  • 77
  • 115
1

Use this one, it's right. :D

AutoCompleteTextView searchText = (AutoCompleteTextView) searchView.findViewById(R.id.abs__search_src_text);
searchText.setHintTextColor(getResources().getColor(color.black));
searchText.setTextColor(getResources().getColor(color.black));
sonida
  • 4,411
  • 1
  • 38
  • 40