Reputation: 41
Is there a way to change the color of a NavigationView or to make it clear so the elements underneath are visible?
struct SwiftUIView: View {
var body: some View {
ZStack {
Color.red.edgesIgnoringSafeArea(.all) //not visible beacause of NavigationView
NavigationView {
Text("Hello, World!")
}.background(Color.clear) //this does nothing
}
}
}
Upvotes: 2
Views: 1057
Reputation: 291
I would do this:
struct SwiftUIView: View {
var body: some View {
NavigationView {
ZStack{
Color.red.edgesIgnoringSafeArea(.all)
Text("Hello, World!")
}
}
}
}
Upvotes: 2