- http://blog.csdn.net/guolin_blog/article/details/12921889
- http://blog.csdn.net/lmj623565791/article/details/38171465
核心方法:
public View inflate(int resource, ViewGroup root, boolean attachToRoot);
知识点:
- Inflate(resId , null) :
- 只创建temp;返回temp
- Inflate(resId , root, false):
- 创建temp,然后执行temp.setLayoutParams(params);返回temp
- Inflate(resId , root, true) :
- 创建temp,然后执行root.addView(temp, params);返回root