How can I ...">

Format link value in android attribute

Let's start with an example.

<attr name="spinnerDropDownItemStyle" format="reference" />

How can I make it out and understand?

I watch Android themes & demystified styles - Google I / O 2016 speaks several times, and I still don’t understand how this reference thing works.

+13
source share
1 answer

The format is referenceused when an attribute refers to another resource identifier. For instance:

<!-- Declaration -->
<attr name="mydrawale" format="reference" />

<!-- Usage -->
app:mydrawable="@drawable/shape1"

, , @layout/..., @color/..., @style/... reference. , color, boolean .., (, 0x00FF00) (, true) .

spinnerDropDownItemStyle - , , @style/..., style.

, , |. , @color/mycolor 0x00FF00.

<attr name="mycolor" format="reference|color" />
+22

Source: https://habr.com/ru/post/1649582/


All Articles