NSCollectionLayoutGroup: Trying to spread items like a normal layout

44 views Asked by At

Using 3 nested groups in 1 section:

  • group 1: animals
  • group 2: colors
  • group 3: size

MY GOAL: For each group, trying to display a spread items like a normal collectionview layout (horizontal & vertically)

NSCollectionLayoutGroup *group = [NSCollectionLayoutGroup horizontalGroupWithLayoutSize:groupSize subitems:items];

Getting wrong spread cells:

enter image description here

trying to get the following result:

enter image description here

I prefer to avoid calculation with customGroup code:

NSCollectionLayoutGroup *group = [NSCollectionLayoutGroup customGroupWithLayoutSize:groupSize itemProvider:^NSArray<NSCollectionLayoutGroupCustomItem *> * _Nonnull(id<NSCollectionLayoutEnvironment>  _Nonnull layoutEnvironment) {
        return .....
    }];
0

There are 0 answers