额,今天决定彻底放弃csdn,因为时间不允许我到处发博了。。所以把一些很早以前的东西,转过来。。

     

  许多UI开发的同学会对 android:的含义有所疑问,细心的同学会发现官方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 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:

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

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

 

 

 



相关文章:

  • 2022-12-23
  • 2021-10-28
  • 2022-02-20
  • 2022-12-23
  • 2021-11-01
猜你喜欢
  • 2021-09-12
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-06
  • 2021-09-12
相关资源
相似解决方案