@ Indicates referencing a resource and declares that this is a resource reference-the subsequent text is the resource name provided in the form of @ [package:] type/name.
@ Android: string indicates the referenced system (android. *) resource.
@ String indicates referencing internal application resources
For id, you can use @ + id to create an id
? Reference Property
"?" Reference topic attributes. When you use this tag, the resource name you provide must be located in the topic attributes, because the resource tool considers this resource attribute to be expected, you do not need to explicitly specify its type (? Android: attr/android: textDisabledColor ).
Use topic attributes:
Another resource value allows you to reference the attribute values in the current topic. This attribute value can only be used in style resources and XML attributes. It allows you to change the appearance of the UI element by changing them to the standard changes provided by the current topic, rather than providing specific values.
As shown in the example, we use this feature in layout resources to set the text color to a standard color. These standard colors are defined in the basic system subject:
Java code
<? Xml version = "1.0" encoding = "UTF-8"?>
<EditText id = "text"
Xmlns: android = "http://schemas.android.com/apk/res/android"
Android: layout_width = "fill_parent" android: layout_height = "fill_parent"
Android: textColor = "? Android: textDisabledColor"
Android: text = "@ string/hello_world"/>
Note that this is very similar to resource reference, except that we use a "?" The prefix replaces "@". When you use this tag, you provide the name of the property resource, which will be searched in the topic-because the resource tool knows the required property resource, therefore, you do not need to explicitly declare this type (if so, the form is? Android: attr/android: textDisabledColor ).
In addition to using the resource identifier to query the value in the topic instead of the original resource, here the name syntax for this type is :? [Namespace:] The form of typpe/name is the same as that of "@", which is also optional.