1

Is there anyway to change the default Navigate-Back button color? I am using SwiftUI with NavigationView

enter image description here

2

2 Answers 2

3

You can use the accentColor property on the NavigationView to set the back button color.

Example:

struct ContentView: View {
    var body: some View {
        NavigationView {
            VStack {
                NavigationLink(destination: DetailView()) {
                    Text("Show Detail View")
                }.navigationBarTitle("Navigation")
            }
        }.accentColor(.red) // Replace it with required color.
    }
}

AccentColor view modifier Sets the accent color for this view and the views it contains.

Sign up to request clarification or add additional context in comments.

1 Comment

@John For further customisation, checkout this SO answer : stackoverflow.com/questions/56571349/…
0

NavigationView has two view modifiers that will probably meet your needs: foregroundColor and accentColor.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.