如何使用自定义字体在Android应用程序? [英] How to use custom fonts in an android application?

查看:145
本文介绍了如何使用自定义字体在Android应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Android应用程序中使用新的自定义字体。请precise和解释特定的时候,我是一个新手。也就是说,我希望让我的Andr​​oid应用程序使用这些新的Andr​​oid自定义字体的http://开发商.android.com /设计/风格/ typography.html 。谢谢。请帮助。

I would like to use new custom fonts in an android application. please be precise and specific when explaining, i am a newbie. Namely, i would like to let my android application use these new android custom fonts http://developer.android.com/design/style/typography.html. Thank you. please help.

推荐答案

我们可以使用通过这种方式自定义字体,

We can use custom fonts using this way,

TextView txt = (TextView) findViewById(R.id.custom_font);  
Typeface font = Typeface.createFromAsset(getAssets(), "Chantelli_Antiqua.ttf");  
txt.setTypeface(font);  

请参阅取得全面了解本教程

这篇关于如何使用自定义字体在Android应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆