Частично перезаписать ресурс

Я ищу способ перезаписать стиль только частично:

В values ​​\ styles.xml

<style name = "TitleBarTextAppearance" parent = "android:TextAppearance">
    <item name = "android:textColor">@color/colorAccent</item>
</style>

В v16 \ styles.xml

<style name = "TitleBarTextAppearance" parent = "android:TextAppearance">
    <item name = "android:fontFamily">@font/bilbo_swash_caps</item>
</style>

Однако я хочу, чтобы в обоих случаях textColor был взят из более общего правила. Есть ли способ сделать это?

1
0
38
1
Перейти к ответу Данный вопрос помечен как решенный

Ответы 1

Ответ принят как подходящий

Сделать это можно следующим образом:

values\styles.xml:

<style name = "BaseTitleBarTextAppearance" parent = "android:TextAppearance">
    <item name = "android:textColor">@color/colorAccent</item>
</style>

<style name = "TitleBarTextAppearance" parent = "BaseTitleBarTextAppearance"/>

в вашем v16\styles.xml:

<style name = "TitleBarTextAppearance" parent = "BaseTitleBarTextAppearance">
    <item name = "android:fontFamily">@font/bilbo_swash_caps</item>
</style>

Другие вопросы по теме