If you create a NavigationSplitView
, then the sidebar
is automatically adorned with a sidebar material effect. This affects the views background as well as any controls that are in the view.
What is the correct way to disable this behaviour so that I can use a NavigationSplitView without the material effects being applied?
The best I've come up with so far is to explicitly set the background on the sidebar but I'm curious if that's the correct way or I'm just getting lucky.
struct ContentView: View {
var body: some View {
NavigationSplitView {
// This works, but is it correct?
SidebarView()
.background(.windowBackground)
} detail: {
DetailView()
}
}
}