2

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
        }
        
    }
}

1 Answer 1

2

I would do this:

struct SwiftUIView: View {
var body: some View {
   NavigationView {
        ZStack{
            Color.red.edgesIgnoringSafeArea(.all)
            Text("Hello, World!")
        }
   }
}
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.