Declaration
compose().scrollIndicators(
visibility: SwiftUI.ScrollIndicatorVisibility,
options?: {
axes?: SwiftUI.AxisSet;
}
)nonisolated func scrollIndicators(
_ visibility: ScrollIndicatorVisibility,
axes: Axis.Set = [.vertical, .horizontal]
) -> some ViewParameters
visibility*SwiftUI.ScrollIndicatorVisibilityThe visibility to apply to scrollable views.
options.axesSwiftUI.AxisSetThe axes of scrollable views that the visibility applies to.
Return value
A view with the specified scroll indicator visibility.
Discussion
Use this modifier to hide or show scroll indicators on scrollable
content in views like a ScrollView, List, or TextEditor.
This modifier applies the preferred visibility to any
scrollable content within a view hierarchy.
ScrollView {
VStack(alignment: .leading) {
ForEach(0..<100) {
Text("Row \($0)")
}
}
}
.scrollIndicators(.hidden)Use the ScrollIndicatorVisibility.hidden value to indicate that you
prefer that views never show scroll indicators along a given axis.
Use ScrollIndicatorVisibility.visible when you prefer that
views show scroll indicators. Depending on platform conventions,
visible scroll indicators might only appear while scrolling. Pass
ScrollIndicatorVisibility.automatic to allow views to
decide whether or not to show their indicators.
See also
More in Layout.
- alignmentGuideSets the view's vertical alignment.
- aspectRatioConstrains this view's dimensions to the specified aspect ratio.
- containerCornerOffsetAdjusts the view's layout to avoid the container view's corner insets for the specified edges.
- containerRelativeFramePositions this view within an invisible frame with a size relative to the nearest container.
- controlSizeSets the size for controls within this view.
- defaultScrollAnchorAssociates an anchor to control which part of the scroll view's content should be rendered by default.
- dynamicTypeSizeSets the Dynamic Type size within the view to the given value.
- fixedSizeFixes this view at its ideal size.
- flipsForRightToLeftLayoutDirectionSets whether this view mirrors its contents horizontally when the layout direction is right-to-left.
- framePositions this view within an invisible frame.
- geometryGroupIsolates the geometry (e.g. position and size) of the view from its parent view.
- gridCellAnchorSpecifies a custom alignment anchor for a view that acts as a grid cell.