android:id what is the plus sign for

后端 未结 2 1577
南笙
南笙 2021-02-04 23:47

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 plu

2条回答
  •  逝去的感伤
    2021-02-05 00:33

    The documentation says,

    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"
    

提交回复
热议问题