tabViewSearchActivation
Configures the activation and deactivation behavior of search in the search tab.
Declaration
compose().tabViewSearchActivation(
activation: SwiftUI.TabSearchActivation
)nonisolated func tabViewSearchActivation(
_ activation: TabSearchActivation
) -> some ViewParameters
activation*SwiftUI.TabSearchActivation
Discussion
Use this modifier on a TabView to change how search activation is
handled. The exact activation behavior is determined by the
TabSearchActivation you pass to this modifier:
struct TabExampleView: View {
@State private var text: String = ""
var body: some View {
TabView {
Tab("Books", systemImage: "book") {
BooksTab()
}
Tab(role: .search) {
NavigationStack {
SearchContent()
}
}
}
.searchable(text: $text)
.tabViewSearchActivation(.searchTabSelection)
}
}By default, search is only activated and deactivated by the user.
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.