Difference between “@id/” and “@+id/” in Android

前端 未结 13 2451
悲&欢浪女
悲&欢浪女 2020-11-22 01:20

What is the diffirence between the @id/ and @+id/?

In @+id/ the plus symbol

13条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-22 01:58

    Android uses some files called resources where values are stored for the XML files.

    Now when you use @id/ for an XML object, It is trying to refer to an id which is already registered in the values files. On the other hand, when you use @+id/ it registers a new id in the values files as implied by the '+' symbol.

    Hope this helps :).

提交回复
热议问题