TabBarMinimizeBehavior
A behavior that determines when a tab bar minimizes.
Declaration
type TabBarMinimizeBehavior = 'automatic' | 'never' | 'onScrollDown' | 'onScrollUp';struct TabBarMinimizeBehaviorPass a literal, or build one with SwiftUI.TabBarMinimizeBehavior from import { SwiftUI } from 'swiftui-react-native'.
Type properties
'automatic'SwiftUI.TabBarMinimizeBehavior.automaticDetermine the behavior automatically based on the surrounding context.
'never'SwiftUI.TabBarMinimizeBehavior.neverNever minimize the tab bar.
'onScrollDown'SwiftUI.TabBarMinimizeBehavior.onScrollDownMinimize the tab bar when downwards scrolling starts. Minimizing is supported for tab bars on only iPhone.
'onScrollUp'SwiftUI.TabBarMinimizeBehavior.onScrollUpMinimize the tab bar when upwards scrolling starts. Minimizing is supported for tab bars on only iPhone.
Overview
A minimized tab bar becomes smaller so that the content behind it has more
room. Pass a value of this type to the
View.tabBarMinimizeBehavior(_:) modifier to specify the behavior.
The following example minimizes the tab bar as soon as someone scrolls down through a feed, and restores it when they scroll back up:
TabView {
Tab("Feed", systemImage: "list.bullet") {
FeedView()
}
Tab("Profile", systemImage: "person") {
ProfileView()
}
}
.tabBarMinimizeBehavior(.onScrollDown)From Apple’s SwiftUI documentation. Code samples there are Swift.
Used by
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.