Skip to content

How to expand GridStack to its full intrinsic height? #12

@NickAtGit

Description

@NickAtGit

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions