Reproduced Android XML resource file @, @android: type, @*,? , the meaning of @+ citation and the difference

Source: Internet
Author: User
<span id="Label3"></p><p><p><span style="color: #ff0000;"><strong>Original Address:<span style="color: #ff0000;">http://blog.csdn.net/zfrong/article/details/7332545</span></strong></span></p></p><p><p><strong>Android XML resource file @, @android: type, @*,? , the meaning of @+ citation and the difference<br></strong></p></p><p><p><strong>An [email protected] represents a reference resource</strong></p></p><p><p><strong>1. Reference a custom Resource. Format: @[package:]type/name</strong></p></p><p><p>android:text= "@string/hello"</p></p><p><p><strong>2. Refer to System Resources. Format: @android: Type/name</strong></p></p><p><p>android:textcolor= "@android: color/opaque_red"</p></p><p><p><span style="color: #ff0000;">note: <strong>In fact @android: Type/name is a subclass of @[package:]type/name</strong> </span></p></p><p><p></p></p><p><p><strong>Two [email protected]* represents a non-public resource referencing the System. Format: @*android:type/name</strong></p></p><p><p><strong></strong> System Resource definitions are divided between public and Non-public. The declaration of public is in:</p></p><p><p><sdk_path>\platforms\android-8\data\res\values\public.xml</p></p><p><p><strong>@*android:type/name:</strong> can invoke all system-defined resources</p></p><p><p><strong>@android: type/name:</strong> A resource that can only invoke the Publi Property.</p></p><p><p><span style="color: #ff0000;">note: resources that are not declared in Public.xml are not recommended by Google. </span></p></p><p><p></p></p><p><p><strong>Three.? Delegate reference topic Properties</strong></p></p><p><p>Another resource value allows you to reference the value of a property in the current Theme. This property value can only be used in style resources and XML attributes, and it allows you to change the appearance of UI elements by changing them to the standard changes provided by the current topic, rather than providing specific values. For example:</p></p><p><p>android:textcolor= "? android:textdisabledcolor"</p></p><p><p><span style="color: #ff0000;">Note that this is very similar to resource references, except that we use a "?" Prefix instead of "@". When you use this tag, you provide the name of the property resource, which will be looked up in the subject, so you do not need to display the declaration of that type (if the declaration is in the form of android:attr/android:textdisabledcolor). In addition to using the identifier of this resource to query the values in the topic instead of the original resource, its naming syntax is the same as "@":? [namespace:]type/name, This type is optional.] </span></p></p><p><p></p></p><p><p>Four <strong>[email protected]+ represents a resource in the creation or reference. Format: @+type/name</strong></p></p><p><p>Meaning: "+" means that a record is added to the inner class named type in R.java. As the meaning of "@+id/button" is in the ID of the R.java file, this static inner class adds a constant named Button. The constant is the identifier for the Resource. If the identifier (including system resources) already exists, it indicates that the identifier is Referenced. The most common use is in defining the resource id, for example:</p></p><p><p>@+id/resource ID Name Create a new resource ID</p></p><p><p>@id/resource ID name to apply an existing defined resource id, including the system ID</p></p><p><p>@android: Id/resource IDs reference the system id, which is equivalent to the @id/resource ID name</p></p><p><p>Android:id= "@+id/selectdlg"</p></p><p><p>Android:id= "@android: id/text1"</p></p><p><p>Android:id= "@id/button3"</p></p><p><p></p></p><p><p><span style="color: #ff0000;">Five questions</span></p></p><span style="color: #ff0000;"><span style="color: #ff0000;">Let's see http://blog.csdn.net/zfrong/article/details/7332545</span> .</span><br><span style="color: #ff0000;"><span style="color: #ff0000;">@android: Type/name is referencing system resources</span></span><br><span style="color: #ff0000;"><span style="color: #ff0000;">now there are XML resources in the A.jar ... A.jar is a Third-party UI development package ... How do I quote in my project? </span></span><p><p>Reproduced Android XML resource file @, @android: type, @*,? , the meaning of @+ citation and the difference</p></p></span>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.