Structure

HStack

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

Declaration 宣言

@frozen struct HStack<Content> where Content : View

Overview 概要

Unlike LazyHStack, which only renders the views when your app needs to display them onscreen, an HStack renders the views all at once, regardless of whether they are on- or offscreen. Use the regular HStack 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 horizontal stack of five text views:


var body: some View {
    HStack(
        alignment: .top,
        spacing: 10
    ) {
        ForEach(
            1...5,
            id: \.self
        ) {
            Text("Item \($0)")
        }
    }
}

Five text views, named Item 1 through Item 5, arranged in a

Topics 話題

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

Supporting Types 支援を行う型

Default Implementations 省略時実装

Relationships 関係

Conforms To 次に準拠

See Also 参照

Stacks