我想删除底部填充,即红色空间之间的空白。有什么办法可以实现吗?
测试代码:
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)
}
}
}
你必须通过0
没有间距。默认情况下,它会根据上下文占用默认空间
VStack(spacing: 0) {
// the same result with using List instead of ScrollView
ScrollView {
.........
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)