How do I change the background of my app in Swift Playgrounds App Project?
How to do I change the background of the app?
Do you want to change the color ?
Simplest is to use ZStack
struct ContentView: View {
var body: some View {
ZStack {
Color.purple
.ignoresSafeArea()
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("Hello, world!")
}
}
}
}
You can use a gradient, an image instead of plain color…
Get details here:
https://sarunw.com/posts/how-to-set-screen-background-color-in-swiftui/