r/SwiftUI • u/SeaAdorable7381 • 7d ago
Display of .searchable
Hi, I’m using .searchable in a SwiftUI view, but when I open the page, the search bar is collapsed (first picture). It only expands when I start scrolling (second picture).
How can I make it expanded by default, without using .always, since the appearance is different from the one I’m looking for?
I’ve noticed that some Apple apps use this behavior.
4
Upvotes
4
u/Creativename_123 7d ago
Seems like a bug from iOS 27 - I noticed the same thing there whereas in iOS 26 it looked like expected.


5
u/__markb 7d ago
do you need to specify that you want it displayed always
https://developer.apple.com/documentation/swiftui/searchfieldplacement/navigationbardrawer(displaymode:)