前言
xcode 13.2.1
iOS 15.0
1、初始化list
List(0 ..< 5) {
_ in
Text("666")
}
或者使用 forEach
List {
ForEach(0 ..< 5) {
_ in
Text("666")
}
}
2 list方法使用
2.1 去掉分割线
cell 中设置listRowSeparator 方法为hidden
List {
ForEach(0 ..< 5) {
_ in
Text("666")
.listRowSeparator(.hidden)
}
}