何时对 XML 属性使用问号?
When to use a question mark for XML attributes?
一些 XML 属性需要以问号 (?
) 开始其值,我只是想知道我怎么知道这些属性,尤其是这些属性,在我按下时不显示on ( CTRL + Space ) 显示建议的属性
这些属性的示例:
android:divider="?android:dividerHorizontal"
android:textAppearance="?android:textAppearanceLarge"
?
用于引用样式属性; documentation 解释说:
To reference a style attribute, the name syntax is almost identical to the normal resource format, but instead of the at-symbol (@
), use a question-mark (?
), and the resource type portion is optional.
?[<package_name>:][<resource_type>/]<resource_name>
一些 XML 属性需要以问号 (?
) 开始其值,我只是想知道我怎么知道这些属性,尤其是这些属性,在我按下时不显示on ( CTRL + Space ) 显示建议的属性
这些属性的示例:
android:divider="?android:dividerHorizontal"
android:textAppearance="?android:textAppearanceLarge"
?
用于引用样式属性; documentation 解释说:
To reference a style attribute, the name syntax is almost identical to the normal resource format, but instead of the at-symbol (
@
), use a question-mark (?
), and the resource type portion is optional.
?[<package_name>:][<resource_type>/]<resource_name>