Contents

paging

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

Declaration

static var paging: PagingScrollTargetBehavior { get }

Discussion

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)

See Also

Getting the scroll target behavior