见附件
我正在使用下面主题的搜索栏(我对Android主题知之甚少)
如何输入文字,在这种情况下,"嗨妈妈"白?
<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>
答案 0 :(得分:2)
<style name="_Credential" parent="android:Theme.Holo.Light.DarkActionBar">
...
<item name="android:editTextColor">#ffffff</item> <!--Allow to change the editText color-->
...
</style>
答案 1 :(得分:1)
因此,您实际上无法使用android:textColor
更改类似搜索框的TextColor。相反,您需要使用textColor...
属性的整个系列。
创建一个自定义样式,将主要样式作为其父样式,然后将所有三种颜色更改为您想要的颜色。所以,像这样:
<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>
详细了解此here。