defaultTabBarPlacement
Specifies 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.
Declaration
compose().defaultTabBarPlacement(
defaultPlacement: SwiftUI.AdaptableTabBarPlacement
)nonisolated func defaultTabBarPlacement(
_ defaultPlacement: AdaptableTabBarPlacement
) -> some ViewParameters
defaultPlacement*SwiftUI.AdaptableTabBarPlacement
Discussion
On platforms that support adapting between a sidebar and tab bar
(currently iPadOS), use
View.defaultAdaptableTabBarPlacement(_:) to configure the
adaptable tab bar.
This modifier is effective on platforms where the
TabViewStyle.sidebarAdaptable style statically resolves to
either a sidebar or tab bar, such as iPhone, macOS, tvOS, and
visionOS. On iPadOS (where the bar is adaptable), this modifier
has no effect.
The following example shows a TabView that prefers to display
a sidebar on platforms where the bar cannot morph:
TabView {
Tab("Home", systemImage: "house") {
HomeView()
}
Tab("Favorites", systemImage: "star") {
FavoritesView()
}
}
.tabViewStyle(.sidebarAdaptable)
.defaultTabBarPlacement(.sidebar)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.
- 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.
- navigationTitleConfigures the view's title for purposes of navigation, using a localized string resource.