4

iOS7 adds padding (64px) for the status bar. Therefore when using a Scrollview there is a big camp between the scrollview and the navigation bar. I tried:

self.automaticallyAdjustsScrollViewInsets = NO;

Which does remove the unwanted padding - however the scrollview no longer scrolls.

Is there another way?

* update **

I discovered a quick fix. I was lining up the scrollview and y origin= 64px in the storyboard instead of 0. I put my scroll view to 0px (the navigation bar then covered 64px of my scrollview) and when I ran it on the simulator it was aligned as originally intend ... a bit of a hack tho. I'm looking for a solid solution however.

DevC
  • 6,982
  • 9
  • 45
  • 80

1 Answers1

10

On your XIB/Storyboard for your view controller, make sure to uncheck the Adjust Scroll View Insets. You may also need to uncheck Under Top Bars and Under Bottom Bars:

enter image description here

Wayne Hartman
  • 18,369
  • 7
  • 84
  • 116
  • Thanks, it didnt work unfortunately. My little hack seems to be working at the moment – DevC Oct 11 '13 at 15:07
  • 1
    @Gman For me it didnt work when viewcontroller was used by page controller. So I changed that in page controller and it worked. Perhaps you have some external controller to screen that has that problem. – Leszek Zarna Oct 11 '13 at 17:00
  • At first this didn't work for me neither, but later I found that if your view controller is embedded in a navigation controller/tabbar controller etc., you should uncheck this option for both your view controller and the wrapping one. – Eddie Deng Dec 29 '15 at 07:14