fontFamily 属性无法通过 textAppearance 工作

Axb*_*rov 2 android android-layout android-fonts android-studio

我有下一个风格:

 <style name="Text.Light">
        <item name="android:fontFamily">@font/open_sans_light</item>
    </style>
Run Code Online (Sandbox Code Playgroud)

如果我在设计时TextView通过textAppearancelike将它设置为in xml ,android:textAppearance="@style/Text.Italic"它会显示斜体字体,但在运行时它不会影响。但是,如果直接在 TextView 中使用 fontFamily 就像android:fontFamily="@font/open_sans_italic"它在两种情况下(设计和运行时)都完美无缺。我究竟做错了什么?有我的字体系列 xml:

<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:ignore="UnusedAttribute">

    <font
        android:font="@font/open_sans_regular"
        android:fontStyle="normal"
        android:fontWeight="400"
        app:font="@font/open_sans_regular"
        app:fontStyle="normal"
        app:fontWeight="400" />

    <font
        android:font="@font/open_sans_italic"
        android:fontStyle="italic"
        android:fontWeight="400"
        app:font="@font/open_sans_italic"
        app:fontStyle="italic"
        app:fontWeight="400" />
</font-family>
Run Code Online (Sandbox Code Playgroud)

Axb*_*rov 12

问题是我选择textViewStyle了我的AppTheme并且有fontFamily. 根据帖子 textAppearance具有最低优先级,它不能覆盖主题或其他任何地方定义的其他样式。