sharedBackgroundVisibility(_:)
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.
Declaration
nonisolated func sharedBackgroundVisibility(_ visibility: Visibility) -> some CustomizableToolbarContent
Parameters
- visibility:
The visibility of the background effect.
Discussion
This modifier adjusts the visibility of that effect. Hiding the effect will cause the item to be placed in its own grouping.
ContentView()
.toolbar(id: "main") {
ToolbarItem(id: "build-status", placement: principal) {
BuildStatus()
}
.sharedBackgroundVisibility(.hidden)
}