How to remove separator between the rows in a List and how to alternate color between adjacent rows?
List {
ForEach(sections) { section in
Section(section.id) {
ForEach(Array(section.enumerated()), id: \.offset) {
HistoryRowView(value: $0.element) .listRowSeparator(.hidden)
.listRowBackground((($0.offset % 2) == 0) ? Color("rowColorLight") : Color("rowColor"))
}
}
}
}
Leave a Reply