This repository has been archived by the owner on May 1, 2024. It is now read-only.
[Enhancement] [CollectionView] Allow ItemTemplate to set SpanSize in grid layout mode #6357
Labels
a/collectionview
inactive
Issue is older than 6 months and needs to be retested
proposal-open
t/enhancement ➕
Projects
Summary
CollectionView right now (X.F 4.0.0.425677) doesn't have option to set ColumnSpan/RowSpan for ItemTemplates in Vertical/Horizontal grid layout mode.
API Changes
In Android GridLayoutManager there is option to set SpanSizeLookup, so implementation would be fairly easy.
iOS however can more hacky, because as far i know, there is no mechanism for defining span size for items, but UIColectionView can be very handy with different view cell sizes. So maybe manipulating cell size inside layoutAttributesForItemAtIndexPath method inside UICollectionViewFlowLayout would accomplish this feature: (code from stackoverflow answer)
The iOS part is obviously harder, but i think that everyone would love to use this feature in their apps.
Intended Use Case
We could use this enhancement to create layouts that looks like this:
If idea with making customs span sizes is too hard, then for first iteration of this enhancement you could only add the possibility to render items with FullSpanSize (there is property in Android StaggeredGridLayoutManager to achieve this) so we could make layout like this:
The text was updated successfully, but these errors were encountered: