Modifiers
scrollTargetBehavior
Sets the scroll snapping behavior for scrollable views. Use with scrollTargetLayout on the content container.
scrollTargetBehavior(behavior)
iOS 17+
| Parameter | Type | Description |
|---|---|---|
behavior | 'paging' | 'viewAligned' | 'paging' for container-aligned snapping, 'viewAligned' for view-aligned snapping. |
Sets the scroll snapping behavior for scrollable views. Use with scrollTargetLayout on the content container.
Returns: ModifierConfig
See: Official SwiftUI documentation.
Works with
Sources
The original Expo docs for this page:
- scrollTargetBehavior (Modifiers) (
source-of-truth/versions/v57.0.0/sdk/ui/swift-ui/modifiers.md)