Home > Mobile >  Layout has two contains & lt; Merge> The & lt; Include> How to differentiate between tags, wit
Layout has two contains & lt; Merge> The & lt; Include> How to differentiate between tags, wit

Time:12-02

When part of the layout of the
 
Layout="@ layout/layout_sport_strength_indicator"/& gt;

Layout="@ layout/layout_sport_strength_indicator"/& gt;


Label layout_sport_strength_indicator. XML is & lt; Merge> , two use viewbinding to include the contents of the assignment, by giving layout_sport_strength_indicator. The corresponding binding XML file binding parent layout method, is to be able to get to the first include the contents of the tag,

If & lt; Include> In the label no & lt; Merge> , you can by giving & lt; Include> Set the id, by id access them respectively, but & lt; Include> Contains & lt; Merge> When, how to distinguish them?



CodePudding user response:

If with the merge of XML is me. The XML, binding is quoted me. The XML page ViewBind
 meBinding meBinding=meBinding. Bind (binding. Root) 

Get me. XML ViewBind, then can use
  • Related