部分效果图:
核心代码:
listView纵向滑动样子
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
mRecyclerView.setLayoutManager(linearLayoutManager);
listView横向滑动样子
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
mRecyclerView.setLayoutManager(linearLayoutManager);
GridView纵向滑动有3列
GridLayoutManager gridLayoutManager=new GridLayoutManager(this,3);
gridLayoutManager.setOrientation(GridLayoutManager.VERTICAL);
mRecyclerView.setLayoutManager(gridLayoutManager);
GridView横向滑动有3行
GridLayoutManager gridLayoutManager=new GridLayoutManager(this,3);
gridLayoutManager.setOrientation(GridLayoutManager.HORIZONTAL);
mRecyclerView.setLayoutManager(gridLayoutManager);
瀑布流效果纵向滑动有3列
StaggeredGridLayoutManager staggeredGridLayoutManager= new StaggeredGridLayoutManager(3,StaggeredGridLayoutManager.VERTICAL);
mRecyclerView.setLayoutManager(staggeredGridLayoutManager);
瀑布流效果横向滑动有3行
StaggeredGridLayoutManager staggeredGridLayoutManager= new StaggeredGridLayoutManager(3,StaggeredGridLayoutManager.HORIZONTAL);