#7f00 .... #f00

Difference between value definition in color and drawable tag?

<resources> <drawable name="red">#7f00</drawable> .... <color name="solid_red">#f00</color> ..... </resources> 

This is some part of colors.xml from the Android Samples Catalog.

Now my question is, what is the difference between the color definition in the <drawable> tag and the <color> ?

+4
source share
1 answer

In principle, nothing. They both create a resource that is a โ€œcolorโ€ value containing 32-bit color. One of them is just a taut subtype, one is a color subtype. When you extract a Drawable from resources, if the resource is actually a color constant, it knows how to create a Drawable object for it.

+5
source

All Articles