Silk block color changing text

I am using the sherlock Version 4.1.0 action bar (2012-05-17). How to change the text color in this screenshot? It is readable on the device itself.

enter image description here

I have this topic

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

And this is 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" > 
+6
source share
4 answers

thanks to this Reply to: background change for 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); ... 
+1
source

In fact, I was able to stylize the color of the text SearchView 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> 
+3
source

I have no experience with Sherlock, but you tried to add:

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

for the Sherlock action bar theme?

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

 <color name="my_color">#ff00ff00</color> 
+1
source

Use this, this is correct .: D

 AutoCompleteTextView searchText = (AutoCompleteTextView) searchView.findViewById(R.id.abs__search_src_text); searchText.setHintTextColor(getResources().getColor(color.black)); searchText.setTextColor(getResources().getColor(color.black)); 
+1
source

Source: https://habr.com/ru/post/921936/


All Articles