<!--
{
  "availability" : [
    "iOS: 17.1.0 -",
    "iPadOS: 17.1.0 -",
    "macCatalyst: 17.1.0 -",
    "macOS: 14.1.0 -",
    "tvOS: 17.1.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/searchPresentationToolbarBehavior(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE33searchPresentationToolbarBehavioryQrAA06SearchefG0VF"
  },
  "title" : "searchPresentationToolbarBehavior(_:)"
}
-->

# searchPresentationToolbarBehavior(_:)

Configures the search toolbar presentation behavior for any
searchable modifiers within this view.

```
nonisolated func searchPresentationToolbarBehavior(_ behavior: SearchPresentationToolbarBehavior) -> some View
```

## Discussion

By default on iOS, a toolbar may hide parts of its content when
presenting search to focus on searching. You can override
this behavior by providing a value of
[`avoidHidingContent`](/documentation/SwiftUI/SearchPresentationToolbarBehavior/avoidHidingContent)
to this modifer.

```
@State private var searchText = ""

List {
    // ... content
}
.searchable(text: $searchText)
.searchPresentationToolbarBehavior(.avoidHidingContent)
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)