zoukankan      html  css  js  c++  java
  • LayoutInflater中四种类型inflate方法的介绍

    转自:http://blog.csdn.net/aa4790139/archive/2011/05/07/6401556.aspx

    第一种:
    public
    View inflate (int resource, ViewGroup root)
    reSource:View的layout的ID
    root:如果返回null,则将此View作为根,此时就可以应用此View中的其他控件了。
              如果返回!null, 则将默认的layout作为View的根。
    第二种:
    public
    View inflate (XmlPullParser parser, ViewGroup root)
    parser:你需要解析xml的解析接口
    root:如果返回null,则将此View作为根,此时就可以应用此View中的其他控件了。
              如果返回!null, 则将默认的layout作为View的根。
    第三种:
    public
    View inflate (XmlPullParser parser, ViewGroup root, boolean attachToRoot)
    parser:你需要解析View的xml的解析接口
    root:如果返回null,则将此View作为根,此时就可以应用此View中的其他控件了。
              如果返回!null, 则将默认的layout作为View的根。
    attachToRoot:
            ture:也就将此解析的xml作为View根
            fase:则为默认的xml,作为根视图View
    第四种:
    public
    View inflate (int resource, ViewGroup root, boolean attachToRoot)

    resource:View的layout的ID

    root:如果返回null,则将此View作为根,此时就可以应用此View中的其他控件了。

              如果返回!null, 则将默认的layout作为View的根。

    attachToRoot:

               ture:也就将此解析的xml作为View根
               fase:则为默认的xml,做为根视图View


    作者:KillerLegend
    出处:http://www.cnblogs.com/KillerLegend/
    分享最新的资源,分享个人所得,欢迎关注我的新浪微博
    新浪微博主页:ikey4u
    我的个人博客:www.ikey4u.com
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

     
  • 相关阅读:
    NanoHTTPD服务
    Pattern、Matcher的用法
    浅析protobuf应用
    Socket通信,基本方法介绍
    String常用处理方法
    什么是重做日志?
    控制文件数据字典视图
    删除控制文件
    使用当前副本恢复控制文件
    备份控制文件
  • 原文地址:https://www.cnblogs.com/killerlegend/p/3349663.html
Copyright © 2011-2022 走看看