'Is there any way to control the width of the search field as it's being added to the toolbar while using .searchable on a macOS app?
I'm using SwiftUI to code a macOS app, and I'm adding a .searchable to it, placing the search field on the toolbar. macOS is adding it to the end of the toolbar, which is good. However, it's too wide.
The code is simple
.searchable(
text: $searchText,
placement: .toolbar,
prompt: "Search..."
)
Is there any way to control the width of the search field as it's being added to the toolbar?
Furthermore, is there a way to set it to always display as "minimized" the way some of the macOS apps do?
This is the way it looks on my app:
And this is what it looks like on one of the macOS apps: just a magnifying glass.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


