Using Xcode 26.0.1 and running on iOS Simulator “iPad (A16)” with iOS 26.0.1.
I am presenting a view controller as Full Screen in a navigation controller.
It has a leftBarButtonItem, rightBarButtonItem, and a title.
It also has an image view showing an image with a white background (the image is not full screen).
The leftBarButtonItem’s text and background colors seem to automatically adjust based on the underlying image color and light/dark mode. The title’s text color, however, does not and only uses the system text color based on light/dark mode.
Here is how the view controller is presented:
@IBAction func loginPressed(_ sender: Any) {
let lvc = LoginViewController()
lvc.delegate = self
let nc = UINavigationController(rootViewController: lvc)
nc.modalPresentationStyle = .fullScreen
self.present(nc, animated: true)
}
Here is the viewDidLoad of LoginViewController:
override func viewDidLoad() {
super.viewDidLoad()
self.title = "My Title"
self.view.backgroundColor = .systemBackground
self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Help", style: .plain, target: nil, action: nil)
self.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(doneTapped))
let iv = UIImageView()
iv.image = UIImage(named: "ImageWithWhiteBackground")
iv.contentMode = .scaleAspectFit
iv.translatesAutoresizingMaskIntoConstraints = false
self.view.addSubview(iv)
let wc = NSLayoutConstraint(item: iv, attribute: .width, relatedBy: .equal, toItem: self.view, attribute: .width, multiplier: 1, constant: 0)
let hc = NSLayoutConstraint(item: iv, attribute: .height, relatedBy: .equal, toItem: self.view, attribute: .height, multiplier: 1, constant: 0)
let xc = NSLayoutConstraint(item: iv, attribute: .centerX, relatedBy: .equal, toItem: self.view, attribute: .centerX, multiplier: 1, constant: 0)
let yc = NSLayoutConstraint(item: iv, attribute: .centerY, relatedBy: .equal, toItem: self.view, attribute: .centerY, multiplier: 1, constant: 0)
self.view.addConstraints([wc, hc, xc, yc])
}
This is how the view controller appears in Light Mode in Portrait and Landscape:
The leftBarButtonItem and title text colors are dark because it’s Light Mode — everything is visible and readable.
This is how the view controller appears in Dark Mode in Portrait and Landscape:
The leftBarButtonItem and title text colors are light because it’s Dark Mode — everything is visible and readable. The image height is less than the screen so the view controller’s view (with background color set to systemBackground) is visible at top and bottom. Notice the leftBarButtonItem is white text on a black background (for Dark Mode).
In landscape, the image height is equal to the screen so it’s white at top and bottom.
Notice the leftBarButtonItem is now black text on a white background (even though it’s Dark Mode).
But the title is still white making it invisible.
A side issue is the status bar is also invisible and unreadable.
Is it possible to make the view controller’s title behave like the leftBarButtonItem so that it changes colors based on the underlying background?
Or, what is the suggested or recommended solution for this?
I also tried setting self.navigationItem.titleView to a UILabel with “My Title” but that had the same issue as using self.title.



