Closed writing-shed closed 4 years ago
Hi there,
ZStack
is used here just for specifying the background gradient, so if you'd like to embed the content in a List view, you should rather do something like this:
var body: some View {
GeometryReader { geometry in
ZStack {
self.backgroundGradient
.edgesIgnoringSafeArea(.all)
List {
self.gridView(geometry)
.frame(height: geometry.size.height)
}
}
}
}
This assumes that you'd like the grid to occupy the whole screen. (in case of embedding it in a List
you have to explicitly set QGrid
's height.
Not sure, however, what is your purpose of embedding it in a List, especially that there might be a conflict of vertical scrolling gestures in such case (embedding QGrid
in a List
)
If you embed the ZStack in a List as in the following:
Then you get this in the simulator:
I have tried various experiments and the best I can come up with is to add a frame modifier as in:
But this is still wrong because the grid is in the wrong place (see screenshot) and I can't work out how to fix it. Any ideas?