当前位置: 代码迷 >> Android >> android LayoutInflater实例化的步骤
  详细解决方案

android LayoutInflater实例化的步骤

热度:70   发布时间:2016-05-01 12:29:31.0
android LayoutInflater实例化的方法
在实际开发种LayoutInflater这个类还是非常有用的,它的作用类似于 findViewById(),
不同点是LayoutInflater是用来找layout下xml布局文件,并且实例化!而findViewById()是找具体xml下的具体 widget控件(如:Button,TextView等)。

LayoutInflater inflater = LayoutInflater.from(this); //Obtains the LayoutInflater from the given context.
//  LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
  相关解决方案