【发布时间】:2020-09-23 07:10:55
【问题描述】:
我想删除底部填充,即红色空间之间的空白。有什么方法可以实现吗?
测试代码:
struct ContentView: View {
var body: some View {
return NavigationView {
VStack {
// the same result with using List instead of ScrollView
ScrollView {
ForEach(1..<100) { index in
HStack {
Spacer()
Text("\(index)")
Spacer()
}
}
}.background(Color.red)
HStack {
Spacer()
Text("Test")
Spacer()
}
.background(Color.red)
}
.navigationBarTitle(Text("Test"), displayMode: .inline)
}
}
}
【问题讨论】:
标签: swift swiftui swiftui-list