- 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