Structure

ScrollView

A scrollable view. スクロール可能なビュー。

Declaration 宣言

struct ScrollView<Content> where Content : View

Overview 概要

The scroll view displays its content within the scrollable content region. スクロールビューは、それの内容をスクロール可能なコンテンツ領域内に表示します。 As the user performs platform-appropriate scroll gestures, the scroll view adjusts what portion of the underlying content is visible. ScrollView can scroll horizontally, vertically, or both, but does not provide zooming functionality.

In the following example, a ScrollView allows the user to scroll through a VStack containing 100 Text views. The image after the listing shows the scroll view’s temporarily visible scrollbar at the right; you can disable it with the showsIndicators parameter of the ScrollView initializer.


var body: some View {
    ScrollView {
        VStack(alignment: .leading) {
            ForEach(0..<100) {
                Text("Row \($0)")
            }
        }
    }
}

A scroll view with a series of vertically arranged rows, reading

To perform programmatic scrolling, wrap one or more scroll views with a ScrollViewReader.

Topics 話題

Creating a Scroll View スクロールビューを作成する

Configuring a Scroll View スクロールビューを構成設定する

Supporting Types 支援を行う型

Default Implementations 省略時実装

Relationships 関係

Conforms To 次に準拠

See Also 参照

Scroll Views