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

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -