Android中设置字体加粗显示

Android TextView中字体加粗

布局文件中这样设置即可:
XML/HTML代码
android:textStyle=“bold”

Java文件中:

TextView textView= new TextView(context);//或从xml导入
TextPaint paint = textView.getPaint();
paint.setFakeBoldText(true);

也可以去看看SpannableStringBuilder

发布了28 篇原创文章 · 获赞 4 · 访问量 2485

猜你喜欢

转载自blog.csdn.net/weixin_45050042/article/details/102798462