1.context易得时用(内部使用的是2方法)
LayoutInflater inflater = LayoutInflater.from(context);
inflater.inflater();2 LayoutInflater inflater = context.getSystemService(Context.LAYOUT_INGFLATR_SERVICE);
3 LayoutInflater inflater = getLayoutInflater();
4 (代码也较为简洁) View.intflater(Context context ,int resource,ViewGroup root);