iOS13
status bar
navigation bar
large text mode
user interface

In iOS13 the status bar background colour is different from the navigation bar in large text mode

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

In iOS 13, large-title navigation bars introduced a more explicit split between standard and scroll-edge appearances. That is why the area behind the status bar can look visually different from the navigation bar when large titles are active. The fix is usually not a separate status-bar color hack, but consistent UINavigationBarAppearance configuration for both standard and scroll-edge states.

Why the Colors Diverge

With large titles, UIKit can use a scroll-edge appearance that is more translucent or configured differently from the standard bar appearance. If you style only one state, you end up with:

  • one appearance while content is scrolled to the top
  • another appearance after scrolling
  • a visible mismatch near the status-bar region

That mismatch becomes especially obvious with large titles because the navigation area is taller.

Configure Both standardAppearance and scrollEdgeAppearance

The safest fix is to define one appearance and assign it to both properties.

swift
1import UIKit
2
3func applyNavigationAppearance(_ navigationController: UINavigationController?) {
4    let appearance = UINavigationBarAppearance()
5    appearance.configureWithOpaqueBackground()
6    appearance.backgroundColor = .systemBlue
7    appearance.titleTextAttributes = [.foregroundColor: UIColor.white]
8    appearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
9
10    let navBar = navigationController?.navigationBar
11    navBar?.prefersLargeTitles = true
12    navBar?.standardAppearance = appearance
13    navBar?.scrollEdgeAppearance = appearance
14    navBar?.compactAppearance = appearance
15    navBar?.tintColor = .white
16}

configureWithOpaqueBackground() matters because translucency is often the reason the top area looks different.

Apply the Appearance Early

You can set this in a navigation controller setup method, in viewDidLoad, or globally through appearance proxies. For app-wide styling:

swift
1let appearance = UINavigationBarAppearance()
2appearance.configureWithOpaqueBackground()
3appearance.backgroundColor = .systemBlue
4appearance.titleTextAttributes = [.foregroundColor: UIColor.white]
5appearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
6
7UINavigationBar.appearance().standardAppearance = appearance
8UINavigationBar.appearance().scrollEdgeAppearance = appearance
9UINavigationBar.appearance().compactAppearance = appearance

This avoids screen-by-screen inconsistencies.

Avoid Old Overlay Hacks When Possible

Older iOS fixes often inserted a colored view under the status bar area. That can still work visually, but it is brittle with:

  • safe-area changes
  • modal presentations
  • rotation
  • different navigation states

In iOS 13 and later, appearance APIs are the first tool to reach for.

Large Titles and Scroll Behavior

Large-title navigation bars change appearance as content moves. If you configure only barTintColor or older properties, you can get one look at rest and another look after scrolling. The correct mental model is:

  • 'standardAppearance for normal bar state'
  • 'scrollEdgeAppearance for large-title edge state'

If both should look the same, assign the same configured instance to both.

Test with Real Navigation Flows

Check more than one screenshot. Verify:

  1. initial screen load with large title
  2. after scrolling down
  3. after pushing another controller
  4. light and dark mode

A mismatch often appears only in one of those transitions.

Storyboard and Existing-App Migration Notes

This issue often appears when an older app migrates to iOS 13 appearance APIs gradually. One screen may still rely on older bar properties such as barTintColor, while another screen uses UINavigationBarAppearance. Mixed styling approaches usually produce inconsistent results.

When fixing the issue, standardize on one appearance strategy across the navigation stack rather than patching individual controllers with one-off color views.

Common Pitfalls

  • Styling only standardAppearance and leaving scrollEdgeAppearance at its default.
  • Using old navigation-bar color APIs without the iOS 13 appearance model.
  • Trying to color the status bar region separately instead of fixing bar appearance states.
  • Keeping the bar translucent when the design expects an opaque solid color.
  • Testing only the initial screen state and missing scroll-transition mismatches.

Summary

  • In iOS 13, large titles use appearance states that can differ visually.
  • The usual fix is to configure both standardAppearance and scrollEdgeAppearance.
  • Use an opaque background when you want the top area to match exactly.
  • Prefer UINavigationBarAppearance over manual overlay hacks.
  • Test initial, scrolled, and pushed-controller states to confirm visual consistency.

Course illustration
Course illustration