Contents

PagingScrollTargetBehavior

The scroll behavior that aligns scroll targets to container-based geometry.

Declaration

struct PagingScrollTargetBehavior

Overview

In the following example, every view in the lazy stack is flexible in both directions and the scroll view settles to container-aligned boundaries.

ScrollView {
    LazyVStack(spacing: 0.0) {
        ForEach(items) { item in
            FullScreenItem(item)
        }
    }
}
.scrollTargetBehavior(.paging)

Topics

Creating the target behavior

See Also

Defining scroll targets