首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android LayoutInflater实例化的步骤

2012-12-25 
android LayoutInflater实例化的方法在实际开发种LayoutInflater这个类还是非常有用的,它的作用类似于 fin

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);

热点排行