windowToolbarFullScreenVisibility
Configures the visibility of the window toolbar when the window enters full screen mode.
View ModifieriOS 18.0+macOS 15.0+tvOS 18.0+watchOS 11.0+visionOS 2.0+windowToolbarFullScreenVisibility(_:) in SwiftUI
Declaration
compose().windowToolbarFullScreenVisibility(
visibility: SwiftUI.WindowToolbarFullScreenVisibility
)nonisolated func windowToolbarFullScreenVisibility(
_ visibility: WindowToolbarFullScreenVisibility
) -> some ViewParameters
visibility*SwiftUI.WindowToolbarFullScreenVisibilityThe visibility to use for the window toolbar in full screen mode.
Discussion
By default, the window toolbar will show at the top of the display, above the window's contents.
You can use this modifier to override the default behavior.
For example, you can specify that the window toolbar should be hidden by default, and only show once the mouse moves into the area occupied by the menu bar:
struct RootView: View {
var body: some View {
ContentView()
.toolbar {
...
}
.windowToolbarFullScreenVisibility(.onHover)
}
}See also
More in Navigation.
- assistiveAccessNavigationIconConfigures the view's icon for purposes of navigation.
- asyncImageURLSessionA modifier that adds a URL session for asynchronous images contained in the view to use when fetching image data.
- contentToolbarPopulates the toolbar of the specified content view type with the views you provide.
- defaultAdaptableTabBarPlacementSpecifies the default placement for the tabs in a tab view using the adaptable sidebar style.
- defaultTabBarPlacementSpecifies the preferred placement for the tabs of a TabView in the TabViewStyle.sidebarAdaptable style on platforms where the tab bar cannot adapt between different representations, and only one representation can be shown.
- navigationBarBackButtonHiddenHides the navigation bar back button for the view.
- navigationBarTitleDisplayModeConfigures the title display mode for this view.
- navigationDestinationAssociates a destination view with a presented data type for use within a navigation stack.
- navigationDocumentConfigures the view's document for purposes of navigation.
- navigationLinkIndicatorVisibilityConfigures whether navigation links show a disclosure indicator.
- navigationSplitViewColumnWidthSets a fixed, preferred width for the column containing this view.
- navigationSubtitleConfigures the view's subtitle for purposes of navigation, using a localized string resource.