删除不需要的 ios7 填充 [英] Remove unwanted ios7 padding

查看:33
本文介绍了删除不需要的 ios7 填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS7 为状态栏添加了内边距 (64px).因此,当使用 Scrollview 时,滚动视图和导航栏之间有一个很大的阵营.我试过了:

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.

还有别的方法吗?

* 更新**

* update **

我发现了一个快速修复方法.我在故事板中排列了滚动视图和 y origin= 64px 而不是 0.我将滚动视图设置为 0px(然后导航栏覆盖了滚动视图的 64px),当我在模拟器上运行它时,它按照最初的意图对齐...有点黑客.不过,我正在寻找可靠的解决方案.

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.

推荐答案

在您的视图控制器的 XIB/故事板上,确保取消选中调整滚动视图插入.您可能还需要取消选中Under Top BarsUnder Bottom Bars:

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:

这篇关于删除不需要的 ios7 填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆