ScrollEdgeEffectStyle
A structure that specifies blur transitions between scrolling content and an area with controls, such as toolbars.
Declaration
type ScrollEdgeEffectStyle = 'automatic' | 'hard' | 'soft';struct ScrollEdgeEffectStylePass a literal, or build one with SwiftUI.ScrollEdgeEffectStyle from import { SwiftUI } from 'swiftui-react-native'.
Type properties
'automatic'SwiftUI.ScrollEdgeEffectStyle.automaticA scroll edge effect the system applies automatically when pinned content overlaps scrolling content.
'hard'SwiftUI.ScrollEdgeEffectStyle.hardA scroll edge effect that provides a linear, nearly opaque boundary between pinned controls and scrolling content.
'soft'SwiftUI.ScrollEdgeEffectStyle.softA scroll edge effect that provides a subtle, blurred boundary between pinned controls and scrolling content.
Overview
By default, the system sets an automatic scroll edge effect style to provide
a visual transition between scrolling content and stationary controls at both
edges of the scroll view in the scrolling direction. The system determines which
style to apply based on the platform and context. The
ScrollEdgeEffectStyle.hard style provides a more opaque, clearly
defined linear boundary, and the ScrollEdgeEffectStyle.soft
style provides a subtle blurred transition:
@TabNavigator {
@Tab("Hard") {
@Image(source: "ScrollEdgeEffectStyle-2", alt: "A partial image of a list scrolling behind a bottom toolbar on iPhone. The area where the toolbar overlaps the list content is nearly opaque, with a defined, straight horizontal line at the top.", deviceFrame: "iPhone16-bottom-half") {
ScrollEdgeEffectStyle.hard scroll edge style
}
}
@Tab("Soft") {
@Image(source: "ScrollEdgeEffectStyle-1", alt: "A partial image of a list scrolling behind a bottom toolbar on iPhone. The area where the toolbar overlaps the list is translucent and blurry and gets progressively more opaque from the top to the bottom.", deviceFrame: "iPhone16-bottom-half") {
ScrollEdgeEffectStyle.soft scroll edge style
}
}
@Tab("None") {
@Image(source: "ScrollEdgeEffectStyle-3", alt: "A partial image of a list scrolling behind a bottom toolbar on iPhone. The area where the toolbar overlaps the list is transparent.", deviceFrame: "iPhone16-bottom-half") {
No scroll edge style
}
}
}
Specify a ScrollEdgeEffectStyle for a scroll view using
View.scrollEdgeEffectStyle(_:for:) when the automatic style
the system applies isn't appropriate for your content and controls. Apply
View.scrollEdgeEffectHidden(_:for:) to a scroll view to remove
the scroll edge effect entirely for an edge you specify.
From Apple’s SwiftUI documentation. Code samples there are Swift.
Used by
See also
More in Styles.
- AccessoryCircularCapacityGaugeStyleA gauge style that displays a closed ring that's partially filled in to indicate the gauge's current value.
- AccessoryCircularGaugeStyleA gauge style that displays an open ring with a marker that appears at a point along the ring to indicate the gauge's current value.
- AccessoryLinearCapacityGaugeStyleA gauge style that displays bar that fills from leading to trailing edges as the gauge's current value increases.
- AccessoryLinearGaugeStyleA gauge style that displays bar with a marker that appears at a point along the bar to indicate the gauge's current value.
- ArrangementViewStyleA style that configures an ArrangementView with an arrangement.
- AutomaticArrangementViewStyleThe default arrangement view style.
- AutomaticControlGroupStyleThe default control group style.
- AutomaticDisclosureGroupStyleA disclosure group style that resolves its appearance automatically based on the current context.
- AutomaticFormStyleThe default form style.
- AutomaticLabeledContentStyleThe default labeled content style.
- AutomaticNavigationSplitViewStyleA navigation split style that resolves its appearance automatically based on the current context.
- AutomaticTableStyleThe default table style in the current context.