Artificial intelligent assistant

セルの背景色を変更したい struct ContentView: View { @State var color = false var body: some View { List{…}.listBackground(color ? .white : .black) Toggle("", isOn: $color) } } `.listRowBackground(color ? .white : .black))` `scrollContentBackground``hide`

`.listRowBackground()``List``View`


import SwiftUI

struct ContentView: View {

@State var isBasicColor = true

var body: some View {
List {
Text("Blue")
.listRowBackground(isBasicColor ? Color.blue : .red)
Text("Red")
.listRowBackground(isBasicColor ? Color.red : .white)
Text("Yellow")
.listRowBackground(isBasicColor ? Color.yellow : .blue)
}
.padding()
Toggle("Cell colors", isOn: $isBasicColor)
}
}


![Cell Color](

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 897887559e1f656c0e92423693de3c78