分类:
2010-11-15 16:25:21
The at-symbol (@) at the beginning of the string indicates that the XML parser should parse and expand the rest of the ID string and identify it as an ID resource. The plus-symbol (+) means that this is a new resource name that must be created and added to our resources (in the R.java file). There are a number of other ID resources that are offered by the Android framework. When referencing an Android resource ID, you do not need the plus-symbol, but must add the android package namespace, like so:
android:id="@android:id/empty"
android:id="@+id/myId"
字符串开始的"@"表示XML解析器必须把剩下的ID字符串解析并扩展成一个ID资源。
"+"表示要创建一个新的资源并把它加入资源文件中(R.java)。Android框架提供了很多ID资源,引用这些资源ID时,不需要使用"+",但是必须加入相应Android包的命名空间。