新建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
网友评论