android中英文加粗比較容易,中文加粗如何實現呢?
可以再xml中配置:
android:textStyle="bold"
中文字體加粗
只能在代碼中配置:
TextPaint tp= textview.getPaint();
tp.ssetFakeBoldText(true);
引用Html舉例:
mReasonB.setText(
Html.fromHtml(
getText(R.string.reason_eat).toString()+
"<font color='"+getResources().getColor(R.color.string_title_sub)+"'>"+
getText(R.string.checkmany).toString()+"</font>"));