Android TextView字体加粗效果

两种不同的字体加粗效果:

正常情况下,TextView 设置字体加粗效果,直接在 xml 中设置,

android:textStyle="bold"

第二种,则是通过代码设置 TextView,此处就不要设置 blod 了

getBinding().tv2.getPaint().setFakeBoldText(true);

看下,两种字体的加粗效果,看情况设置吧
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_38515203/article/details/129858083