I have this weird bug only in iOS 11, in lower iOS, everything works fine. The problem is that whenever pushing to a view controller, there is a black space appears on top of the navigation bar. Has anyone else experienced this problem and how to fix it?
The problem is that in case of double velocity that your view size is smaller then the navigation controller view size.
So when you scrolling trough the view's frame is changing during changing of content offset and it's doubles velocity as well.
That would explain that behaviour.
Please try following to fix the problem.
extendedLayoutIncludesOpaqueBars = true
You should add this line at your UIViewController
, UITableViewController
or UICollectionViewController
You can add a constraint of height 44 to the search bar for iOS 11.
if #available(iOS 11.0, *) {
searchBar.heightAnchor.constraint(equalToConstant: 44).isActive = true
}
Had the same issue and fixed it by removing the following piece of code from the parent controller during viewWillDisappear
self.navigationController?.setNavigationBarHidden(true, animated: animated)
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