如何自定义回收站视图的网格布局管理器?

How to customize Grid Layout Manager of recycler view?

我已经成功地使用跨度数为 2 的网格布局方式实现了回收器视图。 现在我想实现如下图所示的东西。为此,我需要自定义我的网格布局管理器,使 1 个元素的跨度计数为 1,其余为 2。有没有可能。

使用 setSpanSizeLookup 将此信息提供给布局管理器。

在此处查看文档: https://developer.android.com/reference/android/support/v7/widget/GridLayoutManager.html