什么是@android之间的区别:和android? [英] What's the difference between @android: and ?android:

查看:162
本文介绍了什么是@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带问号的标识表明您要访问的是在一个风格的主题定义的样式属性,而不是硬编码的属性,如<一个解释href="http://developer.android.com/guide/topics/resources/accessing-resources.html#ReferencesToThemeAttributes"相对=nofollow>引用样式属性。

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

这篇关于什么是@android之间的区别:和android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆