星空网 > 软件开发 > 操作系统

LayoutInflater.inflate() 参数研究

参考连接:http://blog.csdn.net/lovexieyuan520/article/details/9036673 

http://www.2cto.com/kf/201407/313054.html

http://blog.csdn.net/xyz_fly/article/details/37932989

http://blog.jobbole.com/72156/

 

  inflate方法有4种:这个方法重载了四种调用方式,分别为:

1. public View inflate(int resource, ViewGroup root)

2. public View inflate(int resource, ViewGroup root, boolean attachToRoot)

3.public View inflate(

4.public View inflate(

最终调用第四种方法。  

1当root为空,当前布局不起作用,使用根布局的设置。

2当root不为空(root),attachToRoot为false,才能使用该布局的设置。 当attachToRoot为true,该布局被添加到(如果根布局为垂直排列)(挂载?)根布局中,且保留了其自己的layoutparam参数(即该布局的参数设置)。

 

某1楼总结:

true:并且root存在,将false:返回


原标题:LayoutInflater.inflate() 参数研究

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流