`
yaolinnan
  • 浏览: 56713 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
文章分类
社区版块
存档分类
最新评论

Android使用自定义字体

 
阅读更多

在平时的开发中,我们经常会需要使用自定义字体,其实Android textView控件更换字体很简单。

1、将自定义字体放置到工程的assets下的fonts文件夹中,字体格式为tff。

 

2、textView选择自定义字体代码如下:

String content="test";
mText.setText(content);
Typeface tff = Typeface.createFromAsset(getAssets(), "fonts/game.ttf");
mText.setTypeface(tff);

 3、这样就实现了自定义字体的更换。附件为一些常用的字体

 

欢迎去下载我的软件体验:http://android.myapp.com/myapp/detail.htm?apkName=com.yln.history

  • 大小: 2.7 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics