I have created a SwiftUI List
wrapped in a NavigationView
. The title for the list is set in the default way and appears fine: .navigationBarTitle("My Title")
. The problem is the scrolling behavior is broken.
That is, when scrolling the list, the large title should disappear to make way for the navigation bar to appear with the small title. However, the large title is just stuck in place and does not move while the list scrolls behind it in a glitchy looking manner.
Turns out, setting the background of the List
breaks the scrolling behavior. That is, removing .background(Color.red)
on the List
restored the scrolling behavior to normal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With