inflate(@LayoutRes int resource, @Nullable ViewGroup root, boolean attachToRoot)

翻译完英文就懂了
/**
//从一个指定的xml资源中填充一个新的视图层
* Inflate a new view hierarchy from the specified xml resource. Throws
* {@link InflateException} if there is an error.
*
* //参数resource :id用来一个xml布局资源被加载
* @param resource ID for an XML layout resource to load (e.g.,
* R.layout.main_page)
* //参数root : 操作视图去成为父视图在生成的层次结果(如果 attachToRoot 时true)
* @param root Optional view to be the parent of the generated hierarchy (if
* //其他情况,提供一套从root的层次中返回布局的参数值改造一个简单的对象
* attachToRoot is true), or else simply an object that
* provides a set of LayoutParams values for root of the returned
* hierarchy (if attachToRoot is false.)
* 这填充的参数层次是否附属于root参数
* @param attachToRoot Whether the inflated hierarchy should be attached to
* 如果不是,root只用来去创建对应的layoutParams子类从xml的根视图中
* the root parameter? If false, root is only used to create the
* correct subclass of LayoutParams for the root view in the XML.
* 返回根视图在填充的层次中。如果根提供了并且attachToRoot是true;其他情况它就是填充的xml文件的根视图
* @return The root View of the inflated hierarchy. If root was supplied and
* attachToRoot is true, this is root; otherwise it is the root of
* the inflated XML file.
*/

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值