The component in Android needs to be represented by an int value, which is the id attribute value in the component tag.
The id attribute can only accept the value of the resource type, that is, the value that must begin with @, such as @ id/abc and @ + id/xyz.
If "+" is used after @, it indicates that after a layout file is modified and saved, the system will automatically go to the R. java file.
Generate corresponding int type variables. The variable name is the value after "/". For example, @ + id/xyz is generated in the R. java file.
Int xyz = value, where value is a hexadecimal number. If xyz already has a variable with the same name in R. java,
Instead of generating new variables, the component uses the value of the existing variable.
Since the id attribute of a component is a resource id, you can set any existing resource id values, such as @ drawable/icon,
@ String/OK, @ + string/you, etc. You can also set an existing resource id in the android system, for example, @ id/android: list,
So what does android mean? In fact, android is the package of the system's R class (in the R. java file.
You can enter android. R. id. In the Java code editing area to list the corresponding resource IDs. For example, you can also set the id attribute value to @ id/android: message.
<ListView android: id = "@ + id/android: message"
Android: layout_width = "wrap_content"
Android: layout_height = "wrap_content"/>
You can also view the ids defined in the system, go to the <android sdk installation directory> \ platforms \ android-1.5 \ data \ res \ values directory, and find ids. xml file. After opening, the content is as follows:
<? Xml version = "1.0" encoding = "UTF-8"?>
<Resources>
<Item type = "id" name = "price_edit"> false </item>
<Item type = "id" name = "amount_edit"> false </item>
</Resources>
If ids are defined in ids. xml, @ ID/price_edit can be defined as follows in layout; otherwise, @ + id/price_edit
From [Xiao]