RecyclerView 设置跨行显示

//设置跨行显示
mGm.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
    @Override
    public int getSpanSize(int position) {
        switch (mHomeAdapter.getItemViewType(position)) {
            case Constant.ItemViewType.TYPE_APPINFO:
                return 1;
            default:
                return 2;
        }

    }
});

你可能感兴趣的:(RecylcerView)