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

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

谢谢


当前回答

使用textstyle属性为粗体

android:textStyle = "bold";

其他回答

使用textstyle属性为粗体

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加粗。

只使用

android:textStyle="bold"

例子:

用途:android: textStyle =“大胆”

 <TextView
    android:id="@+id/txtVelocidade"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_above="@+id/txtlatitude"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="34dp"
    android:textStyle="bold"
    android:text="Aguardando GPS"
    android:textAppearance="?android:attr/textAppearanceLarge" />

我有一个项目,在其中我有以下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