Created
January 5, 2021 04:20
-
-
Save Jacob-Tate/5fbd3291662a7ec36199e405ea3090a9 to your computer and use it in GitHub Desktop.
There are a few methods listed here I personally use ZStack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using ZStack | |
var body: some View{ | |
ZStack { | |
Color.blue.ignoreSafeArea() | |
// Other content goes here | |
// NOTE: The other content will respect the safe area | |
} | |
} | |
// Using Overlay Modifiers | |
var body: some View{ | |
Color.blue.ignoreSafeArea(.vertical) // Ignore just for the color | |
.overlay( | |
VStack(spacing: 20) { | |
Text("Overlay").font(.largeTitle) | |
Text("Example").font(.title).foregroundColor(.white) | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment