什么是@android之间的区别:和android?
问题描述:
什么
android:color="@android:color/black"
和
style="?android:attr/borderlessButtonStyle"
有什么之间的差异 @
和?
?
这是这些问题是ungoogleable一个,或 ogooglebar 。
This is one of those questions which is ungoogleable, or ogooglebar.
答
(从这个回答和评论)
prefixing带问号的标识表明您要访问的是在一个风格的主题定义的样式属性,而不是硬编码的属性,如引用样式属性。
Prefixing the ID with a question mark indicates that you want to access a style attribute that's defined in a style theme, rather than hard-coding the attribute, as explained in Referencing Style Attributes.
更具体地说,?
意味着间接额外的水平。把它看成是解引用主题属性来获取它所指向的资源,而不是指属性本身。你看这与Android:ATTR /富
More specifically, the ?
implies an extra level of indirection. Think of it as dereferencing a theme attribute to fetch the resource it points to rather than referring to the attribute itself. You see this with ?android:attr/foo