首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

TextView设立中文粗体

2012-09-13 
TextView设置中文粗体在xml布局文件中设置android:textStyle“bold”可以将英文字母和阿拉伯数字设置成粗体

TextView设置中文粗体

在xml布局文件中设置android:textStyle=“bold”可以将英文字母和阿拉伯数字设置成粗体,对中文不起作用。

将中文设置成粗体的方法是: TextView textView = (TextView)findViewById(R.id.textView);

?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?TextPaint tp =?textView?.getPaint();

?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?tp.setFakeBoldText(true);

热点排行