0

I have this adaptive LazyVGrid setup, the problem is that I would like the small cells to wrap up into the space of 1 big cell but I can't find a proper way to do that

This is how my grid

import SwiftUI

struct SubjectsView: View {
    
    @Environment(\.managedObjectContext) private var moc
    @FetchRequest(entity: Subject.entity(), sortDescriptors: []) private var subjects: FetchedResults<Subject>
    
    var body: some View {
        ScrollView(.vertical, showsIndicators: false) {
            LazyVGrid(columns: [GridItem(.adaptive(minimum: 360), spacing: 16, alignment: .top)], spacing: 16) {
                ForEach(subjects, id: \.self) { subject in
                    SubjectCell(subject: subject)
                }
                Spacer()
            }.padding(15)
        }
    }
}

Simulator

Simulator

Luca
  • 914
  • 9
  • 18
  • What do you mean by *big cell* and where it the *small cells*? Would you provide more details? – Asperi Jul 26 '20 at 12:30
  • I’m sorry, as you can see the frame of the cell with the number and the black rectangle (big cells) si bigger than the other ones , almost double the size of the cells that haven’t got a number (small cells), i would like 2 small cells ti fit in the space of 1 big cell – Luca Jul 26 '20 at 13:13

0 Answers0