Post not yet marked as solved
Post marked as unsolved with 1 replies, 1,597 views
Hi,I want to create diffrent cell with seperate color in a section. Reagards,Ranjeetstruct AlternateListCellView: View {
var body: some View {
List {
Section(header: Text("Show alternate cell")) {
ForEach(1...5) { row in
Text("Row Index = \(row)")
}
// "row" variable is out of scope, so its throw compile time error. Is any other way to create section and cell?
// Kindly correct me if Any mistake.
// .listRowBackground(row % 2 == 0 ? Color.orange : Color.yellow)
}
}
.background(Color.purple)
}
}