Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove unwanted ios7 padding

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.

like image 378
DevC Avatar asked Dec 26 '22 19:12

DevC


1 Answers

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

like image 165
Wayne Hartman Avatar answered Jan 11 '23 23:01

Wayne Hartman