two views with same id

后端 未结 3 602
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-03 04:32

How does android use R.id.id_name to find views after inflating the XML?

1.Suppose I have two XML\'s with one button each with same id.

2.I have

3条回答
  •  盖世英雄少女心
    2020-12-03 05:27

    It knows which View should it use, because it looks for View with this specific id in a XML file that is currently set as content view (or is inflated).

提交回复
热议问题