码迷,mamicode.com
首页 > 移动开发 > 详细

android中获取打气筒的几种方式

时间:2015-10-26 20:22:46      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:

1,简单说明,打气筒就是将我们的xml布局转换为我们的view对象,不扯远了,直接看代码

1 A:从context中获取
2 LayoutInflater inflater1 = LayoutInflater.from(this);
3 B:通过Activitiy直接获取
4 LayoutInflater inflater2 = this.getLayoutInflater();
5 C:根据SystemService获取资源
6 LayoutInflater inflater3 = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);

 

android中获取打气筒的几种方式

标签:

原文地址:http://www.cnblogs.com/wjtaigwh/p/4912197.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!