在平时的开发中,我们经常会需要使用自定义字体,其实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
相关推荐
主要介绍了Android使用自定义字体的方法,涉及Android字体设置的步骤与相关注意事项,需要的朋友可以参考下
Smart Fonts for Android:轻轻松松使用 Android 自定义字体
android spinner 自定义 字体大小
这是android使用自定义字体的一个实例,代码很简单,易于学习
android自定义seekbar刻度条控制网页字体大小
Android 自定义字体Fontinator是一个让使用自定义字体更方便的安卓库。
Letter Press Custom typefaces without a single line of code! With Letter Press, adding custom fonts to your app means not a single line of code is needed; simply add the fonts to your app, ...
一个辅助库用于为你的android视图设置自定义字体
本篇文章是对在Android中使用自定义字体的方法进行了详细的分析介绍。需要的朋友参考下
该android工程可直接导入eclipse,通过菜单切换字体