美文网首页iapp学习iApp
iApp-v3 v7列表布局

iApp-v3 v7列表布局

作者: 明日未期 | 来源:发表于2019-03-20 23:05 被阅读0次

    新建v7.myu模块,写入下面的代码

    调用

    ula()
    uls()
    fn v7.v7a()
    

    参数介绍
    id: v7列表控件id
    col: 列数

    //竖直
    fn v7a(id)
    gvs(id,对象)
    cls("android.support.v7.widget.RecyclerView",列表类)
    cls("android.support.v7.widget.LinearLayoutManager",布局管理类)
    javanew(布局,布局管理类,"Context",activity,"int",1,"boolean",false)
    javax(null,对象,列表类,"setLayoutManager","android.support.v7.widget.RecyclerView$LayoutManager",布局)
    end fn
    
    //横向
    fn v7b(id)
    gvs(id,对象)
    cls("android.support.v7.widget.RecyclerView",列表类)
    cls("android.support.v7.widget.LinearLayoutManager",布局管理类)
    javanew(布局,布局管理类,"Context",activity,"int",0,"boolean",false)
    javax(null,对象,列表类,"setLayoutManager","android.support.v7.widget.RecyclerView$LayoutManager",布局)
    end fn
    
    //网格
    fn v7c(id,col)
    gvs(id,对象)
    cls("android.support.v7.widget.RecyclerView",列表类)
    cls("android.support.v7.widget.GridLayoutManager",布局管理类)
    javanew(布局,布局管理类,"Context",activity,"int",col)
    javax(null,对象,列表类,"setLayoutManager","android.support.v7.widget.RecyclerView$LayoutManager",布局)
    end fn
    
    //瀑布流
    fn v7d(id,col)
    gvs(id,对象)
    cls("android.support.v7.widget.RecyclerView",列表类)
    cls("android.support.v7.widget.StaggeredGridLayoutManager",布局管理类)
    javanew(布局,布局管理类,"int",col,"int",1)
    javax(null,对象,列表类,"setLayoutManager","android.support.v7.widget.RecyclerView$LayoutManager",布局)
    end fn
    

    相关文章

      网友评论

        本文标题:iApp-v3 v7列表布局

        本文链接:https://www.haomeiwen.com/subject/csnxvqtx.html