[英]String types not allowed (at 'android:typeface' with value 'Calibri.ttf')
如何將自定義字體設置為應用程序字體? 這是我的設置:
/assets/fonts/Calibri.TTF
android:theme="@style/AppTheme"
style.xml
: <resources> <!-- Application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <!-- All customizations that are NOT specific to a particular API-level can go here. --> <item name="android:typeface">Calibri.ttf</item> </style> </resources>
現在,我無法運行該應用程序。 當我嘗試編譯它時,出現如下錯誤:
error: Error: String types not allowed (at 'android:typeface' with value 'Calibri.ttf')
字體值應類似於這些值。 “正常,無,serif,等寬”
您需要將您的海關字體從Calibri.ttf重命名為calibri.ttf
其次,您不能直接在資源文件中提供字體
嘗試在github上引用它
是的,反思。 這個作品看下面的stackoverflow問題是否可以為整個應用程序設置自定義字體?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.