许多UI开发的同学会对 android:id="@+id/my_button"的含义有所疑问,细心的同学会发现官方SDK是这样解释的,

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

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 theR.javafile). 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 theandroidpackage namespace, like so:

android:id="@android:id/empty"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------


意思也就是说 @符号要通知xml要转换@后面的字符串为ID资源,而+号表示这是要创建一个新的资源名字,并且添加到R.java文件中。

当你要引用已有的资源的时候 可以直接写成 @android:id/empty

更多相关文章

  1. Android所有系统资源图标android.R.drawable查看
  2. Android知识积累
  3. 组件属性
  4. 修改ListView的分割线
  5. android ListView 示例1 entries 指定一个数组资源
  6. 【Android(安卓)应用开发】Android资源文件 - 使用资源存储字符
  7. android 问题总结
  8. Android应用开发相关下载资源(2013/03/22更新)
  9. 修改进度条ProgressBar颜色

随机推荐

  1. Andriod应用开发--第二章作业1--习题答案
  2. Android(安卓)由android:process引发LMK
  3. 请收好这一份全面 & 详细的Android学习指
  4. 完整安卓 Android开发视频教程共10季,迅雷
  5. iPhone和Android UI模式比较列表
  6. 下载AOSP android源码(最小最快下载方式,跳
  7. 【Android】Android之USB
  8. Android电话拨打流程源码分析
  9. 浅析Android单线程模型
  10. Andriod编程基础(一):Andriod的优势及光明