Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1182082
  • 博文数量: 233
  • 博客积分: 6270
  • 博客等级: 准将
  • 技术积分: 1798
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-26 08:32
文章分类

全部博文(233)

文章存档

2011年(31)

2010年(202)

我的朋友

分类:

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包的命名空间。

阅读(533) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~