I need to have a search box on the view but I don't want that ridiculous space at the top (see picture):
Normally I would use the modifiers
.navigationBarTitle("", displayMode: .inline)
.navigationBarHidden(true)
Both do nothing.
Here is an example:
struct ContentView: View {
@State var searchText = ""
var body: some View {
NavigationView {
List {
NavigationLink(destination: Color(.red) ) {
Text("aaa")
}
NavigationLink(destination: Color(.red) ) {
Text("bbb")
}
NavigationLink(destination: Color(.red) ) {
Text("ccc")
}
}
}
.searchable(text: $searchText, prompt: "search...")
.navigationBarTitle("", displayMode: .inline)
.navigationBarHidden(true)
}
Any other options?
NOTE: I am talking about the yellow region. I want to get rid of it.