0

I have used a UITableView control to show a list of customers that the user can select from. I've divided this into a number of sections, because the customers they need to select will vary from day to day — so the sections are used to divide between the days.

For some reason, there's an excessive amount of whitespace being included in the section header. I don't recall this being the case with iOS 5 (which this application was originally developed with).

enter image description here

Can anyone nudge me in the right direction?

FWIW, I'm not suppling a heightForHeaderInSection: method, so it's not that trivial. In the titleForHeaderInSection: method I'm returning a simple NSString* which represents the date.

Andrew
  • 11,894
  • 12
  • 69
  • 85
  • 1
    Is it a Grouped Style? If yes, iOS7 change its behavior. See http://stackoverflow.com/questions/18388429/uitableview-is-starting-with-an-offset-in-ios7 Solution I used: `[myTableView setTableHeaderView:[[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, [myTableView frame].size.width, 0.01f)]]; [self setAutomaticallyAdjustsScrollViewInsets:NO];` – Larme Dec 27 '13 at 10:56
  • Is this inside a container view (embedded controller)? Cause it looks like an empty navigation bar on top of your header view, so you might have embedded a navigation controller instead of just a tableview. – Alladinian Dec 27 '13 at 11:03
  • No, it's a `UITableView`. It appears that with iOS 7 they want the table view to occupy the entire parent view so that you can scroll under the status bar. I don't want that though, because I need to display a summary of data above my table view. – Andrew Dec 27 '13 at 11:10

1 Answers1

0

I used the link to question 18388429 provided by @Larme, and read through the suggestions there.

The simple fix for me was to turn off 'Adjust Scroll View Insets' for the view. That gave me the result I was after.

Community
  • 1
  • 1
Andrew
  • 11,894
  • 12
  • 69
  • 85