我想使用Roboto字體作爲我應用中每個TextViews,EditTexts,Buttons等的默認字體。如何定義使用自定義字體的樣式
我已經把ttf文件放在資產文件夾裏的字體文件夾中。現在我想編輯應用程序樣式,以便使用該字體。 所以,這就是我所做的。
<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定義應用程序的默認字體?在這種情況下,什麼是錯的? 預先感謝您。
這可能有助於http://www.gadgetsaint.com/android/custom-fonts-textview-edittext-android/#.WNive2996Hs – ASP