Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NickAtGit opened this issue Jul 24, 2020 · 0 comments
Open

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

NickAtGit opened this issue Jul 24, 2020 · 0 comments

Comments

@NickAtGit
Copy link

NickAtGit commented Jul 24, 2020

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant