I have a SwiftUI List
that has its listStyle
set to SidebarListStyle
. This gives me a List
that looks like this:
Great! However, I would like to set a different background color on it, and can't seem to figure out how to do it. My code looks like this:
List {
<snip>
}
.listStyle(SidebarListStyle())
.background(Color.yellow.ignoresSafeArea())
But, this effectively does nothing. My List
looks exactly the same. How can I go about setting the background color for this List
?