iPhone SwiftUI layouts
Explore SwiftUI APIs, components, and modifiers with interactive iPhone previews, Swift code, and Apple documentation. Compare every available orientation, appearance, and design.
214elements
View
Scroll Gesture Axis Lock
Sets whether scrollable views within this view lock each scroll gesture to its predominant axis. On macOS, scroll gestures lock to their predominant axis by default. On iOS, iPadOS, Mac Catalyst, visionOS, and watchOS, scroll gestures move along both axes at once.
Explore Scroll Gesture Axis Lock on iPhone in portrait, with SwiftUI code and Apple API documentation.
SwiftUI code
ScrollView([.horizontal, .vertical]) {
Image(.cats)
}
#if os(macOS)
.scrollGestureAxisLock(.disabled)
#else
.scrollGestureAxisLock(.directional)
#endifCompatibility
iOS 27.3+ iPadOS 27.3+ macOS 27.3+ watchOS 27.3+ visionOS 27.3+
Tags
Found an issue or have a suggestion?
All variants
Every available iPhone screenshot for Scroll Gesture Axis Lock.