I'm trying to change the font and padding on the title ("My Title")? So i'm setting the .navigationTitle to have the nice List behavior where as you scroll past the title, it updates the navigation bar title.
Note: I also like to keep the this behavior of having the nav bar title change automagically
Here's my code:
#Preview() {
NavigationView {
List {
ForEach(1..<30) { number in
Text("\(number)")
}.navigationTitle("My Title")
}
}
}


This is a custom solution I came up with. It uses PreferenceKey and GeometryReader to determine the Scroll offset.
I keep track of two state variables: the offset, of course, and the placement of the title. I've tried to replicate as much as possible in the time I had the look and feel of standard NavigationBar. This solutin allows for deeper customisations as you can place any view you want in the overlay where the title is located. There is definitely room for improvement though. Result:
Let me know if that works for you!