We have a modulised App using two Navigation-hierarchies, therefore the two stacked Navbars…
Sometimes, when pulling the refreshcontrol the navbar stays big and does not drop back to the normal size after finishing the refresh. I can only guess, in which case it drops back and in which it doesnt… Visual debugger shows, that the view using this space is a _UINavigationBarLargeTitleView
. In viewDidLoad
, the self.navigationController.navigationBar.prefersLargeTitles
is set to NO
.
RefreshControl is added in viewDidLoad
via:
self.refreshControl = [RefreshControl new];
Some things i already tried:
contentOffset
to (0,-1).YES
, then to NO
.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
Does anyone have an idea what could cause this problem? As i said, i am not even sure when exactly this happens and when not…
It seems that this issue only happens when navigationBar.isTranslucent == false
. I needed this setting to get a real 100% black navigation bar.
For the time being I use this extremely dirty hack, inspired by the answer of Exception:
self.refreshControl?.endRefreshing()
if #available(iOS 11.0, *) {
self.navigationController?.navigationBar.isTranslucent = true
self.navigationController?.navigationBar.isTranslucent = false
}
Definitely a bug from Apple. Could not make it work except for the workaround below.
tableView.reloadData {
// Slightly scroll up, moving the navigation bar back to place
self.tableView.setContentOffset(CGPoint(x: 0, y: -0.3), animated: false)
}
NOTE: Must be after the tableView has reloaded and with no animation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With