use*_*701 170 resources android textview
有没有办法通过XML在TextView中加粗文本?
<TextView
android:textSize="12dip"
android:textAppearance="bold" -> ??
</TextView>
Run Code Online (Sandbox Code Playgroud)
谢谢
Pas*_*TIN 459
我有一个项目,我有以下内容TextView:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="@string/app_name"
android:layout_gravity="center"
/>
Run Code Online (Sandbox Code Playgroud)
所以,我猜你需要使用 android:textStyle
例:
使用: android:textStyle="bold"
<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" />
Run Code Online (Sandbox Code Playgroud)
使用android:textStyle="bold"
像这样
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="12dip"
android:textStyle="bold"
/>
Run Code Online (Sandbox Code Playgroud)
有很多方法可以让 Android TextView 变成粗体。
| 归档时间: |
|
| 查看次数: |
173179 次 |
| 最近记录: |