android bold,Android开发中textStyle=”bold”无效的解决方法
今天使用XML布局布置一个Android界面时发现android:textStyle=”bold”无效,后来发现是英文有效中文无效,可能是字体的原因,可使用下面3方法解决:1.直接在程序中设置:[code]TextView tv_src =(TextView)findViewById(R.id.TextViewId);TextPaint tp=tv_src.getPaint();tp.set...
·
今天使用XML布局布置一个Android界面时发现android:textStyle=”bold”无效,后来发现是英文有效中文无效,可能是字体的原因,可使用下面3方法解决:
1.直接在程序中设置:
[code]
TextView tv_src = (TextView)findViewById(R.id.TextViewId);
TextPaint tp = tv_src.getPaint();
tp.setFakeBoldText(true);
[/code]
2.使用阴影达到加粗字体效果
[code]
android:shadowColor=”#000000″
android:shadowDx=”0.3″
android:shadowDy=”0.3″
android:shadowRadius=”0.3″
[/code]
3.添加有中文加粗的android字体
除非注明,东城雨博客文章均为原创,转载请以链接形式标明本文地址
本文地址: http://eastcityrain.com/archives/576
更多推荐
已为社区贡献3条内容
所有评论(0)