scrollEdgeAppearance not applied when largeTitleDisplayMode = .never

Hi,

I'm trying to use the new scrollEdgeAppearance in order to have a transparent navigation bar background when the table view is scrolled to the top. However, this seems only to work when I use large titles. Is this intended?


navigationItem.title = "Test title"
navigationItem.largeTitleDisplayMode = .never // <- This seems to break it

let standardAppearance = UINavigationBarAppearance()
standardAppearance.configureWithDefaultBackground()
navigationItem.standardAppearance = standardAppearance
           
// This appearance is never applied:
let scrollEdgeAppearance = UINavigationBarAppearance()
scrollEdgeAppearance.configureWithTransparentBackground()
navigationItem.scrollEdgeAppearance = scrollEdgeAppearance


Thanks!

Answered by Sidetalker in 378043022

Correct. To acheive this you'd have to track the contentOffset of the tableView and modify the appearance based on the offset.

Accepted Answer

Correct. To acheive this you'd have to track the contentOffset of the tableView and modify the appearance based on the offset.

Is this written somewhere in the documentation?

Please add this to the documentation of scrollEdgeAppearance

The description on that page says "The appearance settings to use when the edge of any scrollable content reaches the matching edge of the navigation bar."

The word "any" is misleading, because it is not true.

Thank you.

Did you find a workaround or a fix for it? I'm also facing the same problem, I can make it happen for large titles but not for small titles.

According to the modernising apps session from WWDC19 it should work for both

scrollEdgeAppearance not applied when largeTitleDisplayMode = .never
 
 
Q