Android中設置字體加粗顯示

Android TextView中字體加粗

佈局文件中這樣設置即可:
XML/HTML代碼
android:textStyle=“bold”

Java文件中:

TextView textView= new TextView(context);//或從xml導入
TextPaint paint = textView.getPaint();
paint.setFakeBoldText(true);

也可以去看看SpannableStringBuilder

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章