TabViewBottomAccessoryPlacement
A placement of the bottom accessory in a tab view. You can use this to adjust the content of the accessory view based on the placement.
EnumerationiOS 26.0+macOS 26.0+tvOS 26.0+watchOS 26.0+visionOS 26.0+TabViewBottomAccessoryPlacement in SwiftUI
Declaration
type TabViewBottomAccessoryPlacement = SwiftOpaque<'TabViewBottomAccessoryPlacement'>;enum TabViewBottomAccessoryPlacementOverview
The following example shows playback controls when the view is inline, and an expanded slider player view when the view is expanded.
struct MusicPlaybackView: View {
@Environment(\.tabViewBottomAccessoryPlacement) var placement
var body: some View {
switch placement {
case .inline:
ControlsPlaybackView()
case .expanded:
SliderPlaybackView()
}
}You can set the TabView bottom accessory using
View.tabViewBottomAccessory(content:)
TabView {
Tab("Home", systemImage: "house") {
HomeView()
}
Tab("Alerts", systemImage: "bell") {
AlertsView()
}
TabSection("Categories") {
Tab("Climate", systemImage: "fan") {
ClimateView()
}
Tab("Lights", systemImage: "lightbulb") {
LightsView()
}
}
}
.tabViewBottomAccessory {
HomeStatusView()
}From Apple’s SwiftUI documentation. Code samples there are Swift.
See also
More in Navigation.
- AdaptableTabBarPlacementA placement for tabs in a tab view using the adaptable sidebar style.
- AutomaticNavigationTransitionA style that automatically chooses the appropriate presentation transition for the current context.
- ContentToolbarPlacementA region of the interface that hosts its own toolbar content.
- CrossFadeNavigationTransitionA navigation transition that cross-fades between the appearing view and the disappearing view.
- DismissSearchActionAn action that can end a search interaction.
- NavigationBarItemTitleDisplayModeA style for displaying the title of a navigation bar.
- NavigationPathA type-erased list of data representing the content of a navigation stack.
- NavigationPathChainNavigationPath with chained calls: SwiftUI.NavigationPath.append(...).
- NavigationPathCodableRepresentationA serializable representation of a navigation path.
- NavigationSplitViewColumnA view that represents a column in a navigation split view.
- NavigationSplitViewVisibilityThe visibility of the leading columns in a navigation split view.
- NavigationTransitionA type that defines the transition to use when navigating to a view.