2

I'm trying to set a List's background color; but it remains gray.

var body: some View {
        
        List {
            ForEach(...) {
                Section() {
                    Text("not the actual code")
                }
            }
        }
        .listStyle(InsetGroupedListStyle())
        .background(Color.red)
    }

.listRowBackground(Color.green) works for the row, but not the table's background color

Daniel
  • 8,794
  • 4
  • 48
  • 71

1 Answers1

1

Use colorMultiply(Color:)

List {
        ForEach(...) {
            Section() {
                Text("not the actual code")
            }
        }
    }.colorMultiply(Color.green).padding(.top)
Anil Kumar
  • 1,830
  • 15
  • 24