您的位置:首页 > 其它

inflate (int resource, ViewGroup root)关于root 这个参数的最佳解释

2011-12-30 16:59 579 查看
文档:

public View inflate (int resource, ViewGroup root)

....

returns

The root View of the inflated hierarchy. If root was supplied, this is the root View; otherwise it is the root of the inflated XML file.

如果提供root(不传null)时,返回值其实就是这个root,这个方法就是把xml解析成view之后挂载这个root下。

如果传null(不提供root),返回值也是View,它就是xml布局里面的根节点
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐