“Cannot Resolve Symbol” Error when using android:id=“@+android:id/my_id”

后端 未结 3 767
借酒劲吻你
借酒劲吻你 2021-02-18 23:11

When I am adding android:id/background to the namespace, Lint complains that it \"Cannot Resolve Symbol\" even though I am requesting to add it rather than call it. The code wor

3条回答
  •  佛祖请我去吃肉
    2021-02-18 23:22

    If you are creating your own id:

    "@+id/your_new_id"
    

    if you are accessing your already created id

    "@id/your_old_id"
    

    if you are trying to access Android's system created id

    "@android:id/system_id"
    

    you can see the difference, if you are creating your own id then you have to add +. Since you are accessing system ID so you don't have to add +

提交回复
热议问题