TextAppearance does not work in TextView

I am showing related text in a TextView. At the beginning, my code is as follows:

<TextView
     style="@style/informed_consent_check_TextView"
     android:id="@+id/accept_content_1"
     android:text="@string/informed_consent_accept"
     />


<style name="informed_consent_check_TextView" >
    <item name="android:layout_width">match_parent</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:textSize">13dp</item>
    <item name="android:textColor">#fff</item>
    <item name="android:textColorLink">#fff000</item>
</style>

It is working fine. The text of the text link is as follows:

enter image description here

What I want.

However, after moving the text attributes to the style. It does not work properly.

<style name="informed_consent_content_textAppearance">
    <item name="android:textSize">13dp</item>
    <item name="android:textColor">#fff</item>
    <item name="android:textColorLink">#fff000</item>
</style>

<style name="informed_consent_check_TextView" >
    <item name="android:layout_width">match_parent</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:textAppearance">@style/informed_consent_content_textAppearance</item>
</style>

The text of the link displays the wrong color: enter image description here

And then, I move the textAppearance attribute to the TextView. But this is still wrong.

<TextView
     style="@style/informed_consent_check_TextView"
     android:id="@+id/accept_content_1"
     android:text="@string/informed_consent_accept"
     android:textAppearance="@style/@style/informed_consent_content_textAppearance"/>

My device is 4.1.2.

Who can help me. Many thanks.

+4
source share
1 answer

make changes to the textview attribute

android:textAppearance = "@style/informed_consent_content_textAppearance"
+1
source

Source: https://habr.com/ru/post/1535859/


All Articles