Structure

VStack

A view that arranges its children in a vertical line. あるビュー、それは、それの子らをある垂直線に整列します。

Declaration 宣言

@frozen struct VStack<Content> where Content : View

Overview 概要

Unlike LazyVStack, 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)")
        }
    }
}

Ten text views, named Item 1 through Item 10, arranged in a

Topics 話題

Creating a Stack スタックを作成する

Supporting Types 支援を行う型

Default Implementations 省略時実装

Relationships 関係

Conforms To 次に準拠

See Also 参照

Stacks