I have a background with custom color bg.
I assigned it to a VStack;
VStack {
Text("Hello :) ")
}
.background(Color("bg"))
But the color only fills whatever the VStack is displaying, how do I make it fill up the entire screen?
I have a background with custom color bg.
I assigned it to a VStack;
VStack {
Text("Hello :) ")
}
.background(Color("bg"))
But the color only fills whatever the VStack is displaying, how do I make it fill up the entire screen?
You can set the frame of VStack:
VStack {
Text("Hello :) ")
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color("bg"))
try this:
ZStack {
Color("bg").ignoresSafeArea()
VStack {
Text("Hello :) ")
}
}