albert1017

Android的TextView设置加粗对汉字无效

//not work
textView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
    //work!
    static public void setTextBold(TextView textView, boolean isBold) {
        try {
            if(textView != null) {
                Paint paint = textView.getPaint();
                if(paint != null) {
                    paint.setFakeBoldText(isBold);
                }
            }
        } catch (Throwable var3) {
        }

    }

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-02-09
  • 2022-01-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-24
  • 2022-12-23
  • 2021-12-25
  • 2021-11-15
  • 2021-06-14
  • 2022-01-15
  • 2021-07-10
相关资源
相似解决方案