ios - 为什么 VStack 在 iOS13 和 iOS14 之间有不同的行为?
问题描述
在 iOS13 中,VStack
将其内容中心沿垂直方向对齐,如下所示:
在 iOS14 中,VStack
将其内容顶部沿垂直方向对齐:
我使用与下面相同的代码,
GeometryReader { geometry in
VStack(alignment: .leading, spacing: 0) {
ForEach(0 ..< 100) { i in
Text("Row \(i)").foregroundColor(.white)
}
}
}
如何VStack
在 iOS13 中使其顶部边缘对齐?