RecyclerView layoutManager

  1. 垂直 多列
final StaggeredGridLayoutManager layoutManager = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL);
        layoutManager.setGapStrategy(StaggeredGridLayoutManager.GAP_HANDLING_NONE);

2.垂直单行

LinearLayoutManager layoutManager = new LinearLayoutManager(this);

  1. 平行
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
      layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);


阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页