【发布时间】:2013-10-06 10:19:08
【问题描述】:
我想使用 Roboto 字体作为我应用中每个 TextViews、EditTexts、Buttons 等的默认字体。
我已将 ttf 文件放在 assets 文件夹内的 fonts 文件夹中。现在我想编辑应用程序样式,以使用该字体。 所以,这就是我所做的。
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:typeface">ROBOTO-REGULAR.TTF</item>
</style>
但是编译器返回这个错误。
String types not allowed (at 'android:typeface' with value 'ROBOTO-
REGULAR.TTF').
是否可以通过 XML 为应用程序定义默认字体?在这种情况下,有什么问题? 提前谢谢你。
【问题讨论】: