列表行分隔符可见性设置不起作用? Xcode 13
List Row Separator visibility setting not working? Xcode 13
似乎列表中分隔符的可见性设置不起作用。有人知道简单的解决方法吗?
下面是一段示例代码:
import SwiftUI
struct ContentView: View {
var listData = ["John", "Mack", "Bush"]
var body: some View {
List(listData, id: \.self) { name in
Text(name)
}.listRowSeparator(.hidden)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
试试这个
List {
ForEach(listData, id: \.self) { name in
Text(name)
.listRowSeparator(.hidden)
}
}
似乎列表中分隔符的可见性设置不起作用。有人知道简单的解决方法吗?
下面是一段示例代码:
import SwiftUI
struct ContentView: View {
var listData = ["John", "Mack", "Bush"]
var body: some View {
List(listData, id: \.self) { name in
Text(name)
}.listRowSeparator(.hidden)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
试试这个
List {
ForEach(listData, id: \.self) { name in
Text(name)
.listRowSeparator(.hidden)
}
}