UITableView iOS shows extra padding


I have a UITableView in a UITabBarController. When the view is first shown the tableview shows extra padding on the topside. When I switch to a other tab and then back. It appears to be in the correct position.

So my question is how do I remove this annoying padding and make it stay away.

What I have tried (but maybe incorrect?):

  • Uncheck option under bar etc..
  • Make the table header and view size of 0.01f and tried it with nil and 0.

Probably thousand more things but I these these I came across the most on stack overflow

Screenshot of problem:

The problem is the blue area

To avoid extra padding, set your tableview's content insets to Zero.

self.tblView.contentInset = UIEdgeInsetsZero;
self.tblView.scrollIndicatorInsets = UIEdgeInsetsZero;