Large title navigation bar tint color

I have a large title navigation bar with a custom tint color. However, on both the simulator and device, this tint color does not display until the navigation bar is collapsed (on scrolling). It is just displaying a white navigation bar. In dark mode, the bar is black when large, but goes to my custom color when collapsed (on scrolling).

Same here, happening in both light and dark mode, and only happening when compiling with the iOS 13 SDK.

There are new appearance APIs for bars. WWDC 2019: 224 Modernizing your app for iOS 13 discusses them around the 4 minute mark. I'm stull not fully understanding it, but there are three different states: standard, compact, scroll edge. Scroll edge is supposedly used when at the top of a scroll view and now has a transparent background.


The headers for UINavigationBar.h say this:


/*

Fallback Behavior:

1) Appearance objects are used in whole – that is, all values will be sourced entirely from an instance of UINavigationBarAppearance defined by one of these named properties (standardAppearance, compactAppearance, scrollEdgeAppearance) on either UINavigationBar (self) or UINavigationItem (self.topItem).

2) The navigation bar will always attempt to use the most relevant appearance instances first, before falling back to less relevant ones. The fallback logic is:

AtScrollEdge: self.topItem.scrollEdgeAppearance => self.scrollEdgeAppearance => self.topItem.standardAppearance => self.standardAppearance

CompactSize: self.topItem.compactAppearance => self.compactAppearance => self.topItem.standardAppearance => self.standardAppearance

NormalSize: self.topItem.standardAppearance => self.standardAppearance

*/


I have found that the scroll appearance is being used even when I don't have a scroll view! I'm not sure if this is a bug or me not understanding the new behaviour. To get the "old" appearance (without any customisation) I have done this:


navigationItem.scrollEdgeAppearance = navigationController.navigationBar.standardAppearance



If you are customising the appearance I think you need to investigate the new APIs and configure what you want the new way when running on iOS 13.

Thanks!!!!


It worked here.

I am currently setting the color via self.navigationController?.navigationBar.barTintColor and like the user above, it is only showing when the bar is collaped. The extremely alarming part though is that even without compiling the app in Xcode 11, and just downloading existing live app on an iPhone running public beta 13.1, that is still the case. So I'm obviously very concerned that my existing apps will look terrible until I have a new update available for them and they choose to update.

I am seeing this problem even without compiling the app in Xcode 11, and just downloading existing live app on an iPhone running public beta 13.1. Is that not what you have experienced? Very alarming as it makes our app look terrible with big white headers with white text on them.

Here‘s an easy solution: https://stackoverflow.com/a/57152709

I am seeing this too. Any work arounds (besides compiling with Xcode 11 which is not an option at this moment).

Cross-posting this solution: https://developer.apple.com/forums/thread/79117?login=true.

I tried it and it worked fine. It also gives you a bit of an insight into the navigation bar's view hierarchy; fun stuff.

Large title navigation bar tint color
 
 
Q