举例来说,我有一个这样声明的列表
List {
Section {
Text(“Test Row Title 1”)
}
Section {
Text(“Test Row Title 2”)
}
}
是否可以使其样式与 UITableView.Style.insetGrouped 相同?我找不到任何相关信息。
我认为它会像 .listStyle(InsetGroupedStyle())
最佳答案
在 iOS 13.2 中,您可以设置.environment(\.horizontalSizeClass, .regular)
上.listStyle(GroupedListStyle())
获得与 UITableView.Style.insetGrouped
相同的样式。
List {
Section {
Text(“Test Row Title 1”)
}
Section {
Text(“Test Row Title 2”)
}
}.listStyle(GroupedListStyle())
.environment(\.horizontalSizeClass, .regular)
关于ios - 有没有办法在 SwiftUI 中使 List 样式 insetGrouped ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58393346/