Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setting background color when top edge is white
/*
Scenario: Sometimes you want the entire background color to be filled in your SwiftUI
- One solution is to make the color `edgesIgnoringSafeArea(.all)`
- This is not obvious but it seems to work for now
*/
struct Example: View {
var body: some View {
VStack {
Text("Hello")
}.background(Color.blue.edgesIgnoringSafeArea(.all))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment