【发布时间】:2021-04-18 14:22:42
【问题描述】:
这是我的代码:
struct ContentView: View {
var body: some View {
Form {
Section(header:
VStack {
Text("Header line 1")
Text("This is header line 2")
}) {
List {
Text("Item 1")
Text("Item 2")
Text("Item 3")
Text("Item 4")
}
}
}
}
}
问题是我无法让节标题的两行都以相同的方式对齐或对齐。我希望它们都左对齐,但我也愿意让它们都以屏幕为中心。原来如此,对齐方式很奇怪,如下图:
任何建议将不胜感激。
【问题讨论】:
标签: list swiftui header alignment sections