It seems like when placed in a NavigationView, VStacks won't fill the entire vertical space. Or maybe I'm doing something wrong?
var body: some View {
NavigationView {
VStack(alignment: .leading) {
Text("HEY")
}
.frame(width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
.background(.gray)
}
.navigationBarTitle("Reçu", displayMode: .inline)
}
I also customized UINavigationBar
to give it some color and set navigationBarTitle
to inline.
I tried 2 workarounds:
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: Alignment.topLeading)
.frame(width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
The first one fills more vertical space, but not all of it.