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);