I think I'm experiencing a version of this issue as well. The difference is that “Hide during application launch” is not checked, and the issue appears after hiding the status bar when rotating to landscape and then unhiding it again when rotating back to portrait. Here's a minimal reproduction (since you can't upload zip files):
class ViewController: UIViewController {
var statusBarHidden = false
override var prefersStatusBarHidden: Bool {
return statusBarHidden
}
override func viewDidLoad() {
super.viewDidLoad()
title = "This navigation bar will overflow after rotating to landscape and back"
navigationController?.navigationBar.isTranslucent = true
navigationController?.navigationBar.backgroundColor = .systemBlue
}
override func viewWillTransition(
to size: CGSize,
with coordinator: UIViewControllerTransitionCoordinator
) {
super.viewWillTransition(to: size, with: coordinator)
let isLandscape = size.height < size.width
self.statusBarHidden = isLandscape
self.setNeedsStatusBarAppearanceUpdate()
}
}
The issue only happens on iPad so I think @riccardo.dev's hypothesis around no notch and auto layout miscalculation sounds plausible. I also see the problem resolving itself by backgrounding the app and foregrounding it again, or simply by swiping up to show the app switcher.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: