加载view 的方法 获得LayoutInflater的三种方法

  1. 调用Activity的getLayoutInflater()方法

LayoutInflater inflater = getLayoutInflater();

**View view = inflater.inflate(R.layout.xx);

  1. LayoutInflater inflater=LayoutInflater.from(context);
  2. LayoutInflater inflater=

(LayoutInflater)context.getSystemService(Context.LAYOUTINFLATER_SERVICE);

posted @ 2015-09-21 17:38  pepelu  阅读(189)  评论(0编辑  收藏  举报