廢話不多說先上效果圖。

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
