Tôi có một phong cách sử dụng "monospace" trong App Android của tôi:Điều gì đã xảy ra với Monospace trong Android Lollipop?
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar" >
<!-- Customize your theme here. -->
<item name="android:windowNoTitle">true</item>
<item name="android:typeface">monospace</item>
<item name="android:textColorPrimary">@android:color/white</item>
<item name="android:itemTextAppearance">@style/MenuText</item>
</style>
<style name="M13Text">
<item name="android:typeface">monospace</item>
<item name="android:textColor">@android:color/white</item>
<item name="android:textColorLink">@android:color/holo_red_light</item>
</style>
<style name="MenuText">
<item name="android:typeface">monospace</item>
<item name="android:textColor">@android:color/black</item>
</style>
</resources>
Tất cả là tốt cho đến khi Lollipop đến khi nó dường như không sử dụng font Monospace nữa và tôi có thể nhìn thấy nó thay đổi khi tôi lật API từ 19 đến 21 trong Android Studio.
Tôi đã googled và không tìm thấy bất cứ điều gì và tôi đánh giá cao nó chỉ là một vấn đề thẩm mỹ nhưng bất cứ ai có bất kỳ ý tưởng là tại sao?
Tôi không gặp vấn đề gì khi sử dụng 'monospace' trên Android 5.0. [Ứng dụng mẫu này] (https://github.com/commonsguy/cw-omnibus/tree/master/Fonts/FontSampler) hoạt động tốt trên Nexus 4 - Tôi vừa thử nghiệm nó. – CommonsWare
Cảm ơn @CommonsWare. Hiếu kỳ. Tôi rõ ràng đang làm điều gì đó sai vì việc đặt phông chữ trực tiếp không hoạt động ... Tôi tự hỏi nếu thuộc tính cha mẹ có ghi đè thứ gì đó không? –
Bạn đã thử đặt 'android: fontFamily =" @ null "'? – alanv