机器人:ID是什么加号 [英] android:id what is the plus sign for

查看:840
本文介绍了机器人:ID是什么加号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的文件说@ [+]的id /本身份识别码为定义为机器人:ID,从符号表示该加是可选的。但无处可我找什么样的加号表示或不提供这将意味着一个定义。

这是什么意思,为什么是在那里?

解决方案
  

@ + ID /富意味着你在的命名空间创建一个ID名为foo   您的应用程序。您可以使用@ ID / foo的参考。 @android:ID /富   意味着你是指在Android命名空间中定义的ID。   此命名空间是框架的命名空间。在这种情况下,你   需要使用@android:ID /列表@android:ID /空的,因为这些都是   该框架能够找到的ID(框架只知道   在IDS在android命名空间。)

从一个<一个拍摄href="http://groups.google.com/group/android-developers/browse_thread/thread/dc8023b221351aa7?pli=1">"Android开发者|谷歌论坛讨论。<​​/ P>

The document says "@[+]id/myid" as the definition for android:id, from the notation it indicates that the plus is optional. But nowhere can I find a definition of what the plus sign means or not supplying it would mean.

What does it mean and why is it there?

解决方案

@+id/foo means you are creating an id named foo in the namespace of your application. You can refer to it using @id/foo. @android:id/foo means you are referring to an id defined in the android namespace. This namespace is the namespace of the framework. In this case, you need to use @android:id/list and @android:id/empty because these are the id the framework expects to find (the framework knows only about the ids in the android namespace.)

Taken from one of the "Android Developer | Google Groups" discussions.

这篇关于机器人:ID是什么加号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆