psv
psv

Reputation: 3287

Change the default text color of appcompat-v7

I recently changed the ActionBarSherlock library to AppCompat-v7, and the text color of my textviews is a little bit more "light-gray".

I would like to change the default textColor attribute of the library, and here is what I did in my custom theme:

<style name="Theme.myCustom" parent="@style/Theme.AppCompat.Light">
    <item name="android:textColor">@color/textColor</item>
</style>

...where textColor is #000000 (black)

But nothing has changed in my app.

What is the best way to change the default texts color ?

Upvotes: 1

Views: 1935

Answers (1)

takahirom
takahirom

Reputation: 2213

Please try android:textColorPrimary or android:textColorSecondary.

    <item name="android:textColorPrimary">@color/text_on_primary</item>
    <item name="android:textColorSecondary">@color/subtitle_on_primary</item>

Sorry probably you need this.

android:textColor="?android:attr/textColorPrimary"

EDITED

Please try to use TextAppearance.

<style name="Theme" parent="@android:style/Theme"> 
<item name="textAppearanceSmall">@style/MyTextAppearanceSmall</item> 
</style> 
<style name="MyTextAppearanceSmall" parent="@android:style/TextAppearance.Small"> 
<item name="android:textColor">?colorPrimary</item> 


</style>

Upvotes: 1

Related Questions