init(alignment: HorizontalAlignment , spacing: CGFloat?, content: () -> Content)
Creates an instance with the given spacing and horizontal alignment.
あるインスタンスをこの与えられた空きと水平整列で作成します。
Availability 有効性
Technology
@frozen struct VStack<Content> where Content : View
Unlike Lazy
, which only renders the views when your app needs to display them onscreen, a VStack
renders the views all at once, regardless of whether they are on- or offscreen. Use the regular VStack
when you have a small number of child views or don’t want the delayed rendering behavior of the “lazy” version.
The following example shows a simple vertical stack of 10 text views:
var body: some View {
VStack(
alignment: .leading,
spacing: 10
) {
ForEach(
1...10,
id: \.self
) {
Text("Item \($0)")
}
}
}
init(alignment: HorizontalAlignment , spacing: CGFloat?, content: () -> Content)
typealias Body
struct HStack
struct ZStack