Android TextView字体分段加粗改变颜色的方法

1.设置TextView字体加粗
在xml中设置 android:textStyle=”bold”但是这种方法对中文无效
所以第二种方法

TextView tv = (TextView) findViewById(R.id.sample_text);
TextPaint tp = tv.getPaint();
tp.setFakeBoldText(true);

3.通过setTypeface进行加粗

TextView tv = (TextView) findViewById

猜你喜欢

转载自blog.csdn.net/baidu_41666295/article/details/123627142