实战需求
SwiftUI中List提供了Section组件,如何修改section的背景颜色呢?
本文价值与收获
看完本文后,您将能够作出下面的界面
代码
Section基础代码
struct ContentView : View {
var body: some View {
List {
ForEach(0..<3) { section in
Section(header: Text("Section")) {
ForEach(0..<3) { row in
Text("Row")
}
}
}
}
}
}