what is ids.xml used for?

后端 未结 5 611
予麋鹿
予麋鹿 2020-12-13 23:40

Just a quick question, what is the ids.xml used for when developing an Android app? I saw an example on the android resources webpage which contained:



        
5条回答
  •  情书的邮戳
    2020-12-14 00:08

    When creating views dynamically, predefining id's in ids.xml gives the posibility to reference a newly created view. After you use the setId(id) method you can access the view as if it had been defined in XML. This blog post has a nice example.

提交回复
热议问题