在 SwiftUI 中,TableView 被替换为 List。
有没有办法改变列表单元格/行的背景颜色?
我想实现这样的东西,
if (indexPath.row % 2 == 0) {
aCell.backgroundColor = UIColor(red: 0, green: 1, blue: 0, alpha: 1.0)
}
Run Code Online (Sandbox Code Playgroud)
有关一个很好的例子,请参阅文章https://medium.com/@ronm333/improving-the-appearance-of-ios-tableviews-9effb7184efb。