2012-08-02 45 views
6

Estoy usando la barra de acción sherlock Versión 4.1.0 (2012-05-17). ¿Cómo puedo cambiar el color del color del texto en esta captura de pantalla? En el dispositivo real es legible barellyBarra de acciones de Sherlock cambiar el color del texto

enter image description here

tengo este tema

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

Y esto en 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" 
     > 

Respuesta

1

gracias a este 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); 
... 
1

no tengo ninguna experiencia con Sherlock , pero ¿intentó agregar:

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

al tema de la barra de acción de Sherlock?

Y luego, en sus valores/color.xml Tiene el color:

<color name="my_color">#ff00ff00</color> 
+0

sí acaba de probar, agregado a myTheme, no hay efecto – max4ever

3

En realidad me las he arreglado para estilizar el color del texto en SearchView abs 4.2 haciendo lo siguiente:

<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> 
1

Utilice este, es correcto. : D

AutoCompleteTextView searchText = (AutoCompleteTextView) searchView.findViewById(R.id.abs__search_src_text); 
searchText.setHintTextColor(getResources().getColor(color.black)); 
searchText.setTextColor(getResources().getColor(color.black)); 
Cuestiones relacionadas