swift 3 : How to hide status bar without losing height

标签 swift xcode height hide statusbar

当我在 uipageviewcontroller 的一个页面中隐藏状态栏时,然后将整个内容向上移动。

override var prefersStatusBarHidden: Bool {
    return true
}

Show images

我该如何解决这个问题?

最佳答案

在界面生成器中将顶部约束设置为 Top Layout Guide 而不是 View。像这样

enter image description here

Top Layout Guide 将基于状态栏(或电话等),其中 view 将是一个静态值,忽略 View 是否有状态栏。

关于 swift 3 : How to hide status bar without losing height,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41494198/

相关文章:

ios - 使用自动布局调整 View 大小

jQuery .each 和 div 的高度

html - 为 div only css 设置相同的高度和响应度

swift - 快速访问协议(protocol)方法中的变量

ios - 如何获取函数抛出的错误列表?

swift - 如何在 Swift 中删除 AVPlayerViewController 上的双击缩放功能

ios - 我可以通过 Perfect 在 Linux 上使用 Realm 吗?

c++ - 将空的 c++ 文件添加到 xcode 项目会在 obj-c 头文件中创建语法错误

ios - Swift 2.1 - 制作宽度相对于文本长度的动态按钮

javascript - 如何扩展div以覆盖剩余页面高度