pietropizzi / GridStack

A flexible grid layout view for SwiftUI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to expand GridStack to its full intrinsic height?

NickAtGit opened this issue · comments

commented

My cell looks like this:

struct CollectionCell: View {
    var type: PokemonTypes
    
    var body: some View {

        HStack {
            Image(type.imageName)
            
            Divider()

            GeometryReader { geometry in

                GridStack(minCellWidth: geometry.size.width / 2,
                          spacing: 0,
                          numItems: self.type.superEffectiveAgainst.count) { index, cellWidth in
                    
                            Image(self.type.superEffectiveAgainst[index].imageName)
                            .frame(width: cellWidth)
                }
            }
        }
    }
}

And it looks like that in the preview:
Bildschirmfoto 2020-07-24 um 12 50 15

The problem is that it shows only one row and I can scroll inside the table row when there are more than 2 items.
How can I expand the GridStack to its full height?

Thanks!