The placement of a container background.
This method controls where to place a background that you specify with the
``View/containerBackground(_:for:)`` or
``View/containerBackground(for:alignment:content:)`` modifier.
Members (2)
get · iOS 18.0+
navigation
TypeScript
static get navigation(): ContainerBackgroundPlacement
Swift declaration
static let navigation: ContainerBackgroundPlacement
A background placement inside a ``NavigationStack``
or ``NavigationSplitView``.
For translucent backgrounds in a navigation split view, combine this
placement with ``ContainerBackgroundPlacement/navigationSplitView``.
NavigationSplitView {
… sidebar …
.containerBackground(.thinMaterial, for: .navigation)
.containerBackground(Color.green, for: .navigationSplitView)
} detail: {
// … detail …
.containerBackground(.thickMaterial, for: .navigation)
}
get · iOS 18.0+
navigationSplitView
TypeScript
static get navigationSplitView(): ContainerBackgroundPlacement
Swift declaration
static let navigationSplitView: ContainerBackgroundPlacement
A background placement behind the content of a ``NavigationSplitView``.
This is visible behind columns that are made translucent using the
``ContentBackgroundPlacement/navigation`` placement. For expanded split
views, this container background is also visible between the columns as
the divider color.