android - Unable to reference a color attribute in a drawable -
I am trying to create a set of custom colors, so that they can be referenced throughout a topic.
I found a similar post and by following those steps, I am trying to define holo_blue_dark
as a custom color:
res \ Values \ attrs.xml
& lt; Attr name = "holo_blue_dark" format = "reference | color" />
res \ values \ styles.xml
& lt; Style name = "Aaptim.Dark" parent = "Android: theme.holo.lite.darkectionbar" & gt; & Lt; Item name = "holo_blue_dark" & gt; @color / red & lt; / Item & gt; & Lt; / Style & gt;
res \ values \ colors.xml
& lt; Color name = "holo_blue_dark" & gt; # FF33B5E5 & lt; / Color & gt;
In Android Studio 0.8.2, I always get the failure [INSTALL_FAILED_THEME_AAPT_ERROR]
, so I should remember something.
res \ values \ attrs.xml
& lt; Attr name = "holo_blue_dark" format = "color" />
res \ values \ styles.xml
& lt; Style name = "AppTheme.Dark" parent = "android: Theme.Holo.Light.DarkActionBar" & gt; & Lt; Item name = "holo_blue_dark" & gt; @color_your_color & lt; / Item & gt; & Lt; / Style & gt;
res \ values \ colors.xml
& lt; Color name = "your_color" & gt; # FF33B5E5 & lt; / Color & gt;
And make sure that you are using the AppTheme.Dark topic, where you are using that feature.
Comments
Post a Comment