Reproduce (bug only with iPhone devices <= 8, works ok with iPhone X* devices):
- Open search bar (by clicking search item on top bar) in portrait mode
@IBAction func onSearchBarItemClicked(_ sender: UIBarButtonItem) {
present(searchController, animated: true, completion: nil)
}
- Rotate device to landscape position
- Rotate back to portrait position
Now it's below status bar and it overlaps the content at the bottom
How can I fix it?
UISearchController:
searchController = UISearchController(searchResultsController: nil)
searchController.hidesNavigationBarDuringPresentation = false
searchController.dimsBackgroundDuringPresentation = false
searchController.searchBar.keyboardType = UIKeyboardType.asciiCapable
searchController.searchBar.delegate = self
Update
Sample Project: https://github.com/anonym24/SearchBarBelowStatusBar/