Reputation: 11
I'd like to change the color of the text in textColorPrimary
attribute in styles.xml
<item name="textColorPrimary">#FFEB3B</item>
Error:error: style attribute 'attr/textColorPrimary (aka com.example.android.christmasgifts:attr/textColorPrimary)' not found.
Complete error below
Upvotes: 1
Views: 9740
Reputation: 937
I had the same trouble. Error:error: style attribute 'attr/textColorPrimary (aka ...../textColorPrimary)' not found.
Whole information, which is about design, is in values.xml.
I changed from textColorPrimary to android:textColorPrimary and it works now . :)
Upvotes: 11
Reputation: 1
Dalla95's answer is correct, but your case is not error but mine error. To address this, you should specify android: for textColorPrimary, please check code below:
<style name="ToolbarThemeDemo" parent="Theme.AppCompat.Light">
<item name="android:textColorPrimary">@android:color/white</item>
<item name="android:textColorSecondary">@android:color/white</item>
</style>
And for the Color not changing maybe you use it wrong. you should call your theme by :
app:theme="@style/ToolbarThemeDemo"
not below:
style="@style/ToolbarThemeDemo"
Upvotes: 0
Reputation: 442
I think it's missing the prefix android:
<item name="android:textColorPrimary">#FFEB3B</item>
Upvotes: 4