有一种方法来粗体文本在一个TextView通过XML?

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

谢谢


当前回答

使用textstyle属性为粗体

android:textStyle = "bold";

其他回答

Just you need to use 

//for bold
android:textStyle="bold"

//for italic
android:textStyle="italic"

//for normal
android:textStyle="normal"

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textStyle="bold"
    android:text="@string/userName"
    android:layout_gravity="left"
    android:textSize="16sp"
/>

只使用

android:textStyle="bold"

使用android: textStyle =“大胆”

4种方法使Android TextView粗体

像这样

<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="12dip"
android:textStyle="bold"
/>

有很多方法使Android TextView加粗。

我有一个项目,在其中我有以下TextView:

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

我猜你需要使用android:textStyle

使用textstyle属性为粗体

android:textStyle = "bold";