How can I give bold and normal styles inside our styles.xml? The code which I have given is:
<style name="textbold" parent="@android:style/TextAppearance">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textstyle">bold</item>
</style>
<style name="textregular" parent="@android:style/TextAppearance">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textstyle">normal</item>
</style>
But its showing error over here: <item name="android:textstyle">
Double tap the text you want to format. Tap Format, then choose a formatting option like bolding, italics, or changing the font color.
Change Text Style of TextView to BOLD in XML Layout File textStyle attribute of TextView widget accepts on of these values: "bold" , "italic" or "normal" . To change the style to bold, you have to assign textStyle with "bold" .
That's because it's textStyle
, not textstyle
. The attributes are case-sensitive.
<item name="android:textStyle">normal</item>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With