Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I give a style bold in android?

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">

like image 785
Anju Avatar asked Feb 10 '11 05:02

Anju


People also ask

How do I make my font bold on Android?

Double tap the text you want to format. Tap Format, then choose a formatting option like bolding, italics, or changing the font color.

How do I change textView to bold?

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" .


1 Answers

That's because it's textStyle, not textstyle. The attributes are case-sensitive.

    <item name="android:textStyle">normal</item>
like image 152
EboMike Avatar answered Oct 27 '22 00:10

EboMike