Description of the problem: with iOS 7 in grouped UITableView
there is a gap between the top of the table view and the first cell.
The strange part is th
For solve this problem make sure that you unchecked this field on ViewController:
On ViewController >> Attibutes Inspector >> Layout (unchecked - Adjust Scroll View Insets)
if this is not enough, try this on TableView, set Style to Plain:
This will solve your problem
If you are using a UITableView with grouped style and only 1 group, use plain style instead solve your problem.
UITableViewController *tableViewController;
tableViewController = [[UITableViewController alloc] initWithStyle:UITableViewStylePlain];
I am working with Xcode 7.3.1
, iOS9
, and swift 2
. I would like to share what worked for me:
Just add this in you ViewDidLoad
method
self.automaticallyAdjustsScrollViewInsets = false;
Starting in iOS 7, you automatically get a group header and some space. Compare your app to the Settings app and you'll see. You can work around it by telling the UITableView to set the header height as small as possible. See How to hide first group header.
The answer was very funny for me and my team, and worked like a charm
REASON:
We observed that this happens only for the First View in the View Hierarchy, if this first view is a UITableView. So, all other similar UITableViews do not have this annoying section, except the first. We Tried moving the UITableView out of the first place in the view hierarchy, and everything was working as expected.
Go to the attributes inspector of the View Controller by selecting the xib or the controller in Storyboard. Uncheck the Adjust Scroll View Insets in Layout. It will solve the problem