我在xml中定义了一个textview,我按照下面的方法设置了Typeface
textView.setTypeface(APP_FONT_REGULAR); // 在 assests 中自定义字体 (.ttf file).
在xml中设置了 android:textStyle="bold"
但是为什么没有变成粗体字?
如何给字体设置粗体?
我在xml中定义了一个textview,我按照下面的方法设置了Typeface
textView.setTypeface(APP_FONT_REGULAR); // 在 assests 中自定义字体 (.ttf file).
在xml中设置了 android:textStyle="bold"
但是为什么没有变成粗体字?
如何给字体设置粗体?
当调用 setTypeface() 你可以设置外观:
textView.setTypeface(APP_FONT_REGULAR, Typeface.BOLD);