inflate 参数 的解释

root,和attachToRoot
不懂,先留。
attachToRoot
root is null  
true false 无意义
true true  
false false  
false true  









 先记录2种最常见的组合。

1.自定义控件 this + true. 

LayoutInflater.from(context).inflate(R.layout.item_onetextview, this, true);

2.定义 列表的 item

View view=LayoutInflater.from(viewGroup.getContext()).inflate(mresourceID, viewGroup,false);

原文地址:https://www.cnblogs.com/lsfv/p/11113411.html