1

在 iOS13 中,VStack将其内容中心沿垂直方向对齐,如下所示:

在此处输入图像描述

在 iOS14 中,VStack将其内容顶部沿垂直方向对齐:

在此处输入图像描述

我使用与下面相同的代码,

GeometryReader { geometry in
    VStack(alignment: .leading, spacing: 0) {
        ForEach(0 ..< 100) { i in
            Text("Row \(i)").foregroundColor(.white)
        }
    }
}

如何VStack在 iOS13 中使其顶部边缘对齐?

4

0 回答 0