Using "android:textAppearance" on TextView/EditText fails, but "style" works -


This style to see a sample Text View which text XML TextContactContactName to the right I will apply

  & lt; TextView android: id = "@ + id / name" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" Android: Layout_toRightOf = "@ id / photo" Android: Layout_alignTop = "@ id / photo" Android: PaddingLeft = "10dp" Android: text = "first last" style = "@ style / text contact contact name" />   

Now, I have some other things to set up this element, which are not related to the text. ": TextAppearance Android"

  & lt; TextView android: such as i  TextContactContactName  to move and try through applying it to the id = "@ + id / name" Android: Layout_width = "Wrap_content" Android: layout_height = "Wrap_content" Android: layout_toRightOf = "@ id / photo" Android: layout_alignTop = "@ id / photo" Android: PaddingLeft = "L0dp" android: text = "first last" Android: textAppearance   

Unknowingly, text formatting is not being applied.

looks like ( res / value / styles-text.xml ) like this:

  & lt; Style name = "TextContactContactName" & gt; & Lt; Item name = "Android: textSize" & gt; 24sp & lt; / Item & gt; & Lt; Item name = "Android: textcolor" & gt; # 333333 & lt; / Item & gt; & Lt; Item name = "Android: shadowColor" & gt; #fffff & lt; / Item & gt; & Lt; Item name = "Android: shadowDx" & gt; 0 & lt; / Item & gt; & Lt; Item name = "Android: shadowDy" & gt; 1 & lt; / Item & gt; & Lt; Item name = "Android: shadowRadius" & gt; 1 & lt; / Item & gt; & Lt; / Style & gt;   

Am I misusing the textAppearance tag?

I tested on Android 2.2 - HTC Desire

OK, my mistake looks like I did a quick test: < pre> Android: TextView Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" android: text style using text = "style." Style = "@ style / UiTestTextView" /> & Lt; TextView android: layout_width = "wrap_content" Android: Layout_height = "Wrap_content" android: text = "text Aehaparens text style using the". " Android: TextApprerence = "@Style / UiTestTextView" />

More styles- text.xml:

  & lt; Style name = "UiTestTextView" & gt; & Lt; Item name = "android: textcolor" & gt; # Ff0000 & lt; / Item & gt; & Lt; Item name = "Android: text size" & gt; 16sp & lt; / Item & gt; & Lt; Item name = "android: shadowcolor" & gt; # Ffffff & lt; / Item & gt; & Lt; Item name = "android: shadowDx" & gt; 1 & lt; / Item & gt; & Lt; Item name = "android: shadowDy" & gt; 2 & lt; / Item & gt; & Lt; Item Name = "Android: Shadow Radiance" & gt; 3 & lt; / Item & gt; & Lt; / Style & gt;   

The important thing is that the shadow * elements are not text properties and such that will not be enforced by text applications.

I'm going to ask on the Android Developers mailing list, if this is the desired behavior.

Comments