And in the styles.xml I assign " /> And in the styles.xml I assign " /> And in the styles.xml I assign "/>

Assign an attribute to android.TextStyle

136 views Asked by At

I have an attribute to define font weight of TextView in android like this (in attr.xml):

<attr name="textViewWeight">

And in the styles.xml I assign this attribute with value:

<item name=textViewWeight>bold</item>

In the style that is applied for TextView:

<style name="TextStyle" parent="TextAppearance.AppCompat">
<item name="android:textStyle">?attr/textViewWeight</item>
</style>

But the attribute was not resolved. I need to use values like bold instead

<style name="TextStyle" parent="TextAppearance.AppCompat">
<item name="android:textStyle">bold</item>
</style>

Can I somehow achieve to assign an attribute to textStyle like above?

1

There are 1 answers

2
Samuel Marchant On

? is the following what you are also missing for example terminate your markup tag.

</item>