1

Screen shot of my storyboard I have a header view in a table view as shown in the image. I want to start it from the top. but there is a white space between the top space bar and the header view. I did uncheck the Adjust scroll view insect.I want my header view just below the time displayed. I want the header view of the UITableView to appear in the navigation bar. i don't want the white space for the navigation bar. I have also set Top Bar = None in the storyboard

enter image description here

priyankush
  • 11
  • 5
  • In your storyboard, you simulate top bar to none. It does not have any impact at runtime. Does your storyboard show this white space when you don't simulate to none? – Tom Jul 18 '16 at 11:31
  • Possible duplicate of [Why is there extra padding at the top of my UITableView with style UITableViewStyleGrouped in iOS7](http://stackoverflow.com/questions/18880341/why-is-there-extra-padding-at-the-top-of-my-uitableview-with-style-uitableviewst) – Akilan Arasu Jul 18 '16 at 11:47
  • Tom, the top bar has no effect on the story board. – priyankush Jul 18 '16 at 12:00
  • Akilan, I did follow that link. But my problem is different. – priyankush Jul 18 '16 at 12:01
  • You can get rid of the top space using `tableView.contentInset = UIEdgeInsets(top: -offsetTop, left: 0, bottom: 0, right: 0)` where `offsetTop` is the height of the blank space. HOWEVER, if your table has vertical bounce on scroll enabled then the white space will still show when the user drags the tableview down. I am still not sure how to resolve that issue. – Anjan Biswas Feb 05 '18 at 21:54

1 Answers1

0

Try writing

self.automaticallyAdjustsScrollViewInsets = NO;

in your viewcontroller in viewDidLoad.

Sanman
  • 1,158
  • 11
  • 23