I have UITableViewController
as a root of UINavigationController
. And it always appears with a strange white strip at the top
(and the height of that white strip in always height of status bar). If I change background color of tableView to red, strip gets red, so it means that the problem is in UITableViewController
I thought that may be the problem is because of table view header or section header, so I added this code to check
override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 10
}
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
view.backgroundColor = UIColor.green
return view
}
func configureTabeView() {
// self.tableView.contentInset = UIEdgeInsets(top: -1, left: 0, bottom: 0, right: 0)
let viewHeader = UIView(frame: CGRect(x: 0, y: 0, width: 0, height: 1))
viewHeader.backgroundColor = UIColor.red
self.tableView.tableHeaderView = viewHeader
tableView.clipsToBounds = true
}
Where red strip is table header, greed strip is section header. And there is a strange white strip, and scroll indicators have the same offset as white strip height.