在Android中TextView加粗一般放在Xml文件中设置,简单
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold" />
有时候会根据逻辑判断,需要在Java代码中做动态处理:
/**
* 给文本控件加粗
*
* @param textView 控件
* @param isBold 是否加粗
*/
public void setTextBold(TextView textView, boolean isBold