Android自定义字体

Posted newcaoguo

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Android自定义字体相关的知识,希望对你有一定的参考价值。

1、在assets中创建文件夹fonts,放入字体文件.ttf

2、使用实例:

 

[java] view plain copy
 
  1. TextView tv= (TextView)findViewById(R.id.tv);  
  2.    
  3. Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/Lobster.ttf");  
  4. tv.setTypeface(tf);  

以上是关于Android自定义字体的主要内容,如果未能解决你的问题,请参考以下文章