Gerardo Mendez Dot
Gerardo Mendez Dot

Reputation: 209

I'm having problems with "textColor" in my style.xml

That's my style.xml and the error I'm getting after adding textColor item

View post on imgur.com

Another weird things is that "textColor isn't available as u can see in the next image.

View post on imgur.com

and it doesn't matter if I pick any of those hint i get the same error.

What could be wrong?

Upvotes: 1

Views: 43

Answers (2)

ישו אוהב אותך
ישו אוהב אותך

Reputation: 29783

textColor is an attribute provided in AppCompat library, where as android:textColor is provided in Material theme.

Example:

Using Material theme and referring android:textColor attribute:

<style name="AppTheme" parent="android:Theme.Material.Light">
    <item name="android:textColor">@color/blue</item>
    <item name="android:colorPrimary">@color/primary</item>
    <item name="android:colorPrimaryDark">@color/primary_dark</item>
    ....
    ....
</style>

using AppCompat library with only textColor attribute:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="textColor">@color/blue</item>
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>

    ...
    ...

</style>

this answer credit to @rohitarya: https://stackoverflow.com/a/36378905/4758255

Upvotes: 1

ludwiguer
ludwiguer

Reputation: 2235

try with this

android:textColor

Upvotes: 1

Related Questions