ToolbarItem Shared Background Visibility
Controls the visibility of the glass background effect on items in the toolbar. In certain contexts, such as the navigation bar on iOS and the window toolbar on macOS, toolbar items will be given a glass background effect that is shared with other items in the same logical grouping
Platform Compatibility
Tags
SwiftUI Code
NavigationStack {
Text("Foo")
.toolbar {
ToolbarItem {
Button("Account", systemImage: "person.circle", action: action)
}
ToolbarItem {
Button("Account", systemImage: "person.circle", action: action)
}
.sharedBackgroundVisibility(.hidden)
}
}Found an issue or have a suggestion?
More Toolbars Components
View allPrefer Vertical Toolbar Items
A compression behavior that prioritizes keeping toolbar items visible over other elements, such as tabs. By default, tabs are prioritized.
Toolbar Overflow Menu
The overflow menu of a toolbar. An overflow menu represents actions that are always placed in the toolbar’s overflow menu, regardless of the toolbar mode, platform, or customizability.
Pinned Toolbar Item Placement
A placement that pins the item to the trailing edge of the toolbar.
Explore Other Components
Browse allGlass Button Styles
A button style that applies glass border artwork based on the button’s context
MenuPickerStyle
A picker style that presents the options as a menu when the user presses a button, or as a submenu when nested within a larger menu.
ViewThatFits Vertical
A view that adapts to the available vertical space by providing the first child view that fits.
Text Format
Creates a text view that displays the formatted representation of a nonstring type supported by a corresponding format style.