Structure

LazyHStack

A view that arranges its children in a line that grows horizontally, creating items only as needed.

Declaration 宣言

struct LazyHStack<Content> where Content : View

Overview 概要

The stack is “lazy,” in that the stack view doesn’t create items until it needs to render them onscreen.

In the following example, a ScrollView contains a LazyHStack that consists of a horizontal row of text views. The stack aligns to the top of the scroll view and uses 10-point spacing between each text view.


ScrollView(.horizontal) {
    LazyHStack(alignment: .top, spacing: 10) {
        ForEach(1...100, id: \.self) {
            Text("Column \($0)")
        }
    }
}

Topics 話題

Creating a Lazy-Loading Horizontal Stack

Supporting Types 支援を行う型

Default Implementations 省略時実装

Relationships 関係

Conforms To 次に準拠

See Also 参照

Lazy Stacks