In the native Settings app, there's a NavigationView
with a TextField
inside of it that nicely transitions as the user scrolls:
I was able to create something similar using:
struct HomeView: View {
@State var searchQuery: String = ""
var body: some View {
NavigationView {
List {
TextField("Search", text: $searchQuery).textFieldStyle(RoundedBorderTextFieldStyle())
}
.navigationBarTitle(Text("My App"))
}
}
}
which gave me this:
However, this doesn't really look or act the same as the native settings one, and I'm lost on how to even get the search icon in there. Thanks so much!