Android View system analysis (I), androidview
Android parsing problems
I went, but you haven't downloaded the software yet. If you click to install it, the resolution will definitely time out. Please use your computer to download the software for Android, select the number model, copy it to your mobile phone, and click Install, you can.
Xiao Bian of fan an answers your questions and asks for adoption
What is the difference between @ ID/XX and @ + id/xx when defining the Control id in the android page layout? @ Id/xx
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 generate the corresponding int type variable in the R. java file. The variable name is the value after "/". For example, @ + id/xyz will generate int xyz = value in the R. java file, where value is a hexadecimal number. If xyz already has a variable with the same name in R. java, the new variable is not generated, and the component uses the value of this existing variable.
That is to say, if the form of @ + id/name exists in R. java, the component uses the value of this variable as the identifier. If the variable does not exist, add a new variable and assign the corresponding value to the variable (no duplicates ).
Since the id attribute of a component is a resource id, you can set any existing resource id value, for example, @ drawable/icon, @ string/OK, @ + string/you, etc. Of course, you can also set the existing resource id in the android system. For example, what does android mean by @ id/android: list proposed by the landlord? In fact, this android is the system's R class (in R. the package in the 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