我有List
一个Sections
:
List {
ForEach((1...3), id: \.self) { _ in
Section(
header: Text("My Section")
.font(.system(.title3))
.fontWeight(.bold)
.foregroundColor(.primary),
content: {
ForEach((1...5), id: \.self) { _ in
Text("My Row")
}
}
)
}
}
这是使用 iOS 14.5 的 iPhone 8 模拟器上的结果:
这是带有 iOS 15 的 iPhone 8 模拟器上的结果:
我希望 iOS15 列表等于 iOS14.5 之一。.listStyle(PlainListStyle())
我可以通过添加来删除水平填充,List
但该部分的标题仍然具有不同的垂直填充。
有没有办法拥有与 iOS14.5 相同的垂直标题填充?
环境:
- iOS 15 遥控器
- XCode 13 遥控