使用LayoutInflater获取XML配置的Layout
2010-12-19 14:16
441 查看
可以使用LayoutInflater来获取Layout的xml配置。
1、LayoutInflater有2中方式获得:
<1>、LayoutInflater flater= getLayoutInflater();
<2>、LayoutInflater flater= (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
2、获取Layout:
//R.layout.customer是Layout的xml配置
View layout = flater.inflate(R.layout.customer,null);
3、获取Layout中的组件:
ImageView image = (ImageView) layout.findViewById(R.id.imgview);
1、LayoutInflater有2中方式获得:
<1>、LayoutInflater flater= getLayoutInflater();
<2>、LayoutInflater flater= (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
2、获取Layout:
//R.layout.customer是Layout的xml配置
View layout = flater.inflate(R.layout.customer,null);
3、获取Layout中的组件:
ImageView image = (ImageView) layout.findViewById(R.id.imgview);
相关文章推荐
- LayoutInflater的获取与使用
- jsp application使用getInitParameter来获取web.xml中配置参数
- LayoutInflater的获取与使用
- LayoutInflater的获取与使用
- Android布局中LayoutInflater的使用(利用代码添加xml形式的Layout布局)
- android之LayoutInflater的获取与使用
- 使用WWW获取本地文件夹的XML配置文件
- android之LayoutInflater的获取与使用
- LayoutInflater的获取与使用
- jsp application使用getInitParameter来获取web.xml中配置参数
- 11_Android中HttpClient的应用,读取网络xml及xml解析流,Handler的应用,LayoutInflater的使用,SmartImageView的使用
- C#使用单例模式类获取本地程序目录下XML文件中的配置信息
- jsp 使用application.getInitParameter来获取web.xml中配置参数
- jsp application使用getInitParameter来获取web.xml中配置参数
- jsp application使用getInitParameter来获取web.xml中配置参数
- 使用LayoutInflater 获取View对象的方式
- LayoutInflater的获取与使用
- LayoutInflater的获取与使用
- tomcat tomcat-users.xml 配置使用
- LayoutInflater的使用