android - Referencing specific attribute in another style -
I am trying to find the best way to match the text size of labels next to an EditText using XML I am I do not want to inherit the EditText style directly, since a bunch of features that I'm not interested in will bring in
& Lt; TextView Android: id = "@ + id / textUnit" style = "@ style / fontmatchingEditText" Android: Text = "Units" Android: layout_width = "wrap_content" android: layout_height = "wrap_content" />
Is there any way to refer to a specific feature in another style?
Otherwise, does it make sure that it edits text of its own style to make sure it stays compatible with the label?
Edit
I was hoping that there could be an independent free way of doing this, something like:
& lt; Item name = "Android: textSize" & gt; @Android: Style / Widget.EditText.textAppearance.textSize & lt; / Item & gt;
But I'm probably overcomplicating it more thanks!
Assuming your original topic android: Theme.Holo.Light
.
to \ Android-SDK \ platforms \ Android X \ data \ race \ values \ themes.xml
:
to \ android-sdk \ platforms \ android-x \ data \ res \ values \ styles.xml
:
< Code> & lt; Style name = "widget.Holo edit text" original = "widget.edit" & gt; & Lt; / Style & gt; & Lt; Style name = "Widgets." & Gt; ... & lt; Item Name = "Android: Text Appointment" & gt; Android: attr / textAppearanceMediumInverse & lt; / Item & gt; & Lt; Item name = "android: textcolor" & gt; Android: attr / editTextColor & lt; / Item & gt; & Lt; / Style & gt;& lt:
You can now reuse your
TextView
for the subject attributesEditText
Can be used for; Android: text = "Units" Android: layout_width = "wrap_content" Android: "Android: attr / editTextColor": "Android: attr / textAppearanceMediumInverse": id = "@ + id / textUnit" Android textcolor = Android textAppearance = Android: Layout_hehet = "wrap-content" />
Comments
Post a Comment