Include same layout multiple times

前端 未结 4 1148
抹茶落季
抹茶落季 2021-02-13 21:56

I have a common layout (common.xml) which I want to include many times in another layout (layout_a.xml). But it only shows me just one time. Why?

common.xml

4条回答
  •  臣服心动
    2021-02-13 22:17

    As btse said, the ids in the XML must be unique. It can be achieved in this way:

    
    
    
    

    For information about how to access the elements inside those two included views, you can check out this blog post.

提交回复
热议问题