【发布时间】:2018-07-01 14:49:55
【问题描述】:
在procedure 之后,我想将 android 应用程序中所有文本的字体设置为特定名称。这是一种非英文字体,所以我将其粘贴到app\src\main\assets\fonts 并在styles.xml 中写入以下内容
<item name="android:fontFamily">@fonts/my.ttf</item>
<item name="fontFamily">@fonts/my.ttf</item>
但是,在 android studio 中构建并运行应用程序后(模拟器弹出),我看到的是默认字体,而不是我指定的字体。
顺便说一句,在那篇文章中,它使用@font。但是,如果我这样写,我会看到找不到字体的错误。通过更改@fonts,编译错误解决!
这里缺少什么?
【问题讨论】:
标签: android custom-font