Home > database >  How do I move the position of the .searchable() Swift search bar from default?
How do I move the position of the .searchable() Swift search bar from default?

Time:11-18

This question (https://developer.apple.com/forums/thread/682602) explains it far better than I can. I'd like a way to move the search bar that comes with the top of the screen in NavigationViews to a custom location. Is this possible on iOS 15 and before? Or, even on iOS 16 for that matter?

CodePudding user response:

https://developer.apple.com/documentation/swiftui/presentedwindowcontent/searchable(text:tokens:suggestedtokens:placement:prompt:token:)-60iob

There's no parameter for location. It has placement parameter but it controls always showing, automatic showing.

You might be create your own component for search bar.

  • Related