TextView bold via xml file?

user291701 picture user291701 · Mar 3, 2011 · Viewed 186.8k times · Source

Is there a way to bold the text in a TextView via XML?

<TextView
   android:textSize="12dip"
   android:textAppearance="bold"  -> ??
</TextView>

Thanks

Answer

Pascal MARTIN picture Pascal MARTIN · Mar 3, 2011

I have a project in which I have the following TextView :

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textStyle="bold"
    android:text="@string/app_name"
    android:layout_gravity="center" 
/>

So, I'm guessing you need to use android:textStyle