scrollContentBackground
Specifies the visibility of the background for scrollable views within this view.
Declaration
compose().scrollContentBackground(
visibility: SwiftUI.Visibility
)nonisolated func scrollContentBackground(
_ visibility: Visibility
) -> some ViewParameters
visibility*SwiftUI.Visibilitythe visibility to use for the background.
Discussion
The following example hides the standard system background of the List.
List {
Text("One")
Text("Two")
Text("Three")
}
.scrollContentBackground(.hidden)On macOS 15.0 and later, the visibility of the scroll background helps
achieve the seamless window/titlebar appearance for scroll views that
fill the window's content view, or a pane's full width and height.
List and Form have the seamless appearance by default, configurable
by hiding the scroll background. ScrollView can become seamless by
making the background visible.
See also
More in Appearance.
- backgroundSets the view's background to a style.
- badgeGenerates a badge for the view from a localized string resource.
- badgeProminenceSpecifies the prominence of badges created by this view.
- borderAdds a border to this view with the specified style and width.
- buttonSizingThe preferred sizing behavior of buttons in the view hierarchy.
- containerBackgroundSets the container background of the enclosing container using a view.
- headerProminenceSets the header prominence for this view.
- hiddenHides this view unconditionally.
- imageScaleScales images within the view according to one of the relative sizes available including small, medium, and large images sizes.
- labelIconToTitleSpacingSet the spacing between the icon and title in labels.
- labelReservedIconWidthSet the width reserved for icons in labels.
- labelsHiddenHides the labels of any controls contained within this view.