In SwiftUI 3 we used the following code snippet to set the background color of a list.
struct ContentView: View {
var body: some View {
List {
Text("Hello World!")
}
.onAppear {
// Placed here for sample purposes, normally set globally
UITableView.appearance().backgroundColor = .clear
}
.listStyle(.insetGrouped)
.background(Color.red)
}
}
This is not working anymore in SwiftUI 4 (FB10225556) as the List is not based on UITableView anymore. Any workaround ideas?