I implemented a basic UIViewController with a UITableView that\'s wrapped in a UINavigationController. I set prefersLargeTitles
to true:
override fu
I had a similar issue with navigation bar, but in my case it had a custom title view, and navigation bar remained empty until table view is scrolled down, which triggered UILayoutContainerView
to layout its subviews, one of which are navigation controller's view and navigation bar. I assume the root of it is the same as the large title navigation bar issue.
Anchoring tableView
to the safeAreaLayoutGuide
didn't work out for me, largeTitleDisplayMode
couldn't be other then .never
So I managed to fix it by calling self.navigationController?.view.setNeedsUpdateConstraints
in the top presented controller's viewDidAppear(animated:)
function, or scheduling this call for the next run loop in viewWillAppear(animated:)
, like:
DispatchQueue.main.async {
self.navigationController?.view.setNeedsUpdateConstraints()
}
In this case, navigation bar appeared with the correct content and size along with presenting transition, instead of popping in after transition was completed