且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android - 使用自定义字体

更新时间:2021-09-24 22:25:59

在 Mobiletuts+ 上有非常好的 Android 文本格式教程.快速提示:自定义 Android字体

On Mobiletuts+ there is very good tutorial on Text formatting for Android. Quick Tip: Customize Android Fonts

现在自己测试了.这是解决方案.您可以使用名为 fonts 的子文件夹,但它必须位于 assets 文件夹中,而不是 res 文件夹中.所以

Tested it myself now. Here is the solution. You can use a subfolder called fonts but it must go in the assets folder not the res folder. So

资产/字体

还要确保字体结尾我的意思是字体文件本身的结尾都是小写的.换句话说它不应该是myFont.TTF而是myfont.ttf 这种方式必须是小写

Also make sure that the font ending I mean the ending of the font file itself is all lower case. In other words it should not be myFont.TTF but myfont.ttf this way must be in lower case