Reputation: 98
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?
Upvotes: 0
Views: 139
Reputation: 37050
try this:
ZStack {
Color("bg").ignoresSafeArea()
VStack {
Text("Hello :) ")
}
}
Upvotes: 0
Reputation: 54268
You can set the frame of VStack
:
VStack {
Text("Hello :) ")
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color("bg"))
Upvotes: 1