When you click on the button it takes you to a new view and puts a back button in the top left. I can't figure out what property controls the color of the back button. I tried adding an accentColor and foregroundColor but they only edit the items inside the view.
var body: some View { NavigationView { NavigationLink(destination: ResetPasswordView()) { Text("Reset Password") .foregroundColor(Color(red: 0, green: 116 / 255, blue: 217 / 255)) .padding() } } }
navigationBar. barTintColor = UIColor. newBlueColor() and of course this just changes the colour of the navigation bar of the view controller that the code is within.
You can use the accentColor
property on the NavigationView to set the back button color, like in this example:
var body: some View { NavigationView { List(1..<13) { item in NavigationLink(destination: Text("\(item) x 8 = \(item*8)")) { Text(String(item)) } }.navigationBarTitle("Table of 8") }.accentColor(.black) // <- note that it's added here and not on the List like navigationBarTitle() }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With