使用RecyclerView实现带标题的图片展示器

废话不多说先上效果图。

 

RecycleView 加载的是 GridLayoutManager。其中为GridLayoutManager添加了setSpanSizeLookup。代码如下:

gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
if (recycleAdapter.getItemViewType(position) == PhotoDataBean.TYPE_TITLE){
//标题跨4行
return 4;
}
return 1;
}
});


Github 下载地址 https://github.com/Jaelyn5526/RecyclePhoto.git
posted @ 2017-02-23 09:53  Jaelyn静  阅读(4140)  评论(0编辑  收藏  举报