1

See attached

I am using a searchbar with the theme below (I know very little about Android themes, yet)

How do I make the text typed, in this case, "Hi Mom" white?

<style name="_Credential" parent="android:Theme.Holo.Light.DarkActionBar">
  <item name="android:editTextBackground">@drawable/credential_edit_text_holo_light</item>
  <item name="android:textColorHighlight">#99005984</item>
  <item name="android:textSelectHandleLeft">@drawable/credential_text_select_handle_left</item>
  <item name="android:textSelectHandleRight">@drawable/credential_text_select_handle_right</item>
  <item name="android:textSelectHandle">@drawable/credential_text_select_handle_middle</item>
  <item name="android:autoCompleteTextViewStyle">@style/AutoCompleteTextViewCredential</item>
  <item name="android:listChoiceIndicatorMultiple">@drawable/credential_btn_check_holo_light</item>
  <item name="android:listChoiceIndicatorSingle">@drawable/credential_btn_radio_holo_light</item>
  <item name="android:buttonStyle">@style/ButtonCredential</item>
  <item name="android:imageButtonStyle">@style/ImageButtonCredential</item>
  <item name="android:dropDownSpinnerStyle">@style/SpinnerCredential</item>
  <item name="android:progressBarStyleHorizontal">@style/ProgressBarCredential</item>
  <item name="android:seekBarStyle">@style/SeekBarCredential</item>
  <item name="android:ratingBarStyle">@style/RatingBarCredential</item>
  <item name="android:ratingBarStyleIndicator">@style/RatingBarBigCredential</item>
  <item name="android:ratingBarStyleSmall">@style/RatingBarSmallCredential</item>
  <item name="android:buttonStyleToggle">@style/ToggleCredential</item>
  <item name="android:listChoiceBackgroundIndicator">@drawable/credential_list_selector_holo_light</item>
  <item name="android:activatedBackgroundIndicator">@drawable/credential_activated_background_holo_light</item>
  <item name="android:fastScrollThumbDrawable">@drawable/credential_fastscroll_thumb_holo</item>
</style>

enter image description here

Ian Vink
  • 66,960
  • 104
  • 341
  • 555

2 Answers2

2
<style name="_Credential" parent="android:Theme.Holo.Light.DarkActionBar">
      ...
      <item name="android:editTextColor">#ffffff</item> <!--Allow to change the editText color-->
      ...
</style>
TooCool
  • 10,598
  • 15
  • 60
  • 85
1

So you can't actually change the TextColor of something like a search box with android:textColor. Instead, you need to use the whole family of the textColor... attributes.

Create a custom style that has your main style as it's parent, and then change all three kinds of colors to be what you want. So, something like this:

<style name="master" paret="@android:Theme.Holo.Light.DarkActionBar">
    <item name="android:textColorPrimary">#FFFFFF</item>
    <item name="android:textColorSecondary">#FFFFFF</item>
    <item name="android:textColorTertiary">#FFFFFF</item>
</style>

Read more about this here.

Community
  • 1
  • 1
Alex K
  • 8,269
  • 9
  • 39
  • 57