My accent color (which is set to red) will not apply to the sidebar of my NavigationSplitView. So, I tried explicitly setting the tint color to red, and still it does not work. I did try setting other items (such as the foregroundColor of Text) to red or accent, and that worked properly. It is just the sidebar which will not conform.
Does anyone know what could possibly be causing this? I am just learning swift (this is my first project) so please explain things well.
The relevant part of the code:
NavigationSplitView {
// Defining the sidebar items by looping throuhg each item in sidebar array
List(selection: $selectedPage) {
ForEach(Array(sidebar), id: .self) { option in
NavigationLink(value: option.name) {
Image(systemName: option.img)
Text(option.name)
}
}
}
.onAppear{selectedPage = "Changelogs"} // Set the default page
.tint(.red) // Setting tint to red, but the tint is not applying!
}
detail: { ... }
Here is the result, which is still using the default blue tint.
I have accent colour set to “Multicolour” in system preferences, so no conflict happening there.