Android-LayoutInflater

參考文章:

核心方法:

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







發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章