Scrolling in my UITableViewController with several items makes the the cell appear behind my UIStatusBar
. I tried to do a work around using this method:
var bounds = self.view.bounds
bounds.origin.y -= 20.0;
self.view.bounds = bounds
// Create a solid color background for the status bar
let statusFrame = CGRect(x: 0, y: -20, width: bounds.size.width, height: 20)
let statusBar = UIView(frame: statusFrame)
statusBar.backgroundColor = UIColor.red
self.view.addSubview(statusBar)
which will give me a red bar before scrolling. It disappears after a little bit of scrolling. I also tried to make the contentInset of the tableView top to UIApplication.shared.statusBarFrame.height
, but did the same.
It is important to keep the Navbar. Also my TableViewController is embedded in a UINavigationController
Any ideas?