Sunday, 18 August 2013

textColor and textAppearance of edittext

textColor and textAppearance of edittext

Here is my code
<style name="AppBaseTheme" parent="android:Theme.Light">
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:textAppearance">@style/App_TextAppearance</item>
<item name="android:editTextStyle">@style/App_EditTextStyle</item>
<item name="android:textViewStyle">@style/App_TextViewStyle</item>
</style>
<style name="App_TextAppearance" parent="@android:style/TextAppearance">
<item name="android:textColor">#ffff0000</item>
</style>
<style name="App_EditTextStyle" parent="@android:style/Widget.EditText">
<item name="android:textAppearance">?android:textAppearance</item>
</style>
<style name="App_TextViewStyle" parent="@android:style/Widget.TextView">
<item name="android:textAppearance">?android:textAppearance</item>
</style>
The problem is, now the textcolor of all textviews are RED, but the
textcolor of all edittexts are still black. I know i need to set a
android:textColor attribute item to the App_EditTextStyle to change the
edittext's color, but why? Is the android:textAppearance attr useless for
edittext?

No comments:

Post a Comment