Remove unwanted ios7 padding

孤街浪徒 提交于 2020-01-14 10:47:28

问题


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.


回答1:


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:



来源:https://stackoverflow.com/questions/19319961/remove-unwanted-ios7-padding

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!