ios - 在选项卡栏 Controller 中嵌入导航 Controller 会更改 View Controller 的安全区域

标签 ios swift4 xcode9.2 ios11.2

我有一个 View ,我想用顶部的导航和底部的标签栏来显示它。此 View 将从顶级选项卡栏 Controller 中的选项卡打开。

当我在该 View 的选项卡栏 Controller 中嵌入导航 Controller 时,我的 ViewController 内的安全区域发生变化。嵌入操作从顶部和底部添加一些偏移量。

在嵌入之前它看起来像: before embed

嵌入后变成这样: after embed

View 设置面板如下所示: enter image description here

为什么会这样?我该如何解决这个问题?

最佳答案

我通过取消选中导航 Controller 的显示导航栏设置解决了该问题。

untick Shows Navigation Bar for Navigation Controller

关于ios - 在选项卡栏 Controller 中嵌入导航 Controller 会更改 View Controller 的安全区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48109022/

相关文章:

ios - 来自资源的 Spritekit/Universal 图像未显示在 iOS 9 上?

ios - 如何在TableView上打开PDF文件?

ios - 如何将图像添加到相机覆盖 View (swift4)

swift - 在测试中模拟 UIView 扩展 "ApiProtocol"- swift4

Swift 选择器输入值设置为指定的 url

xcode9.2 - Xcode 9.3 在导出构建时崩溃

ios - 为什么我的分布式应用程序看起来与在 xcode 中调试时不同?

ios - 我想更改 IB 中 View 的名称。请看截图

ios - Xcode 8 不编译使用 `self` 的类型推断属性

ios - 如何使用 IB_DESIGNABLE 在 Storyboard中可视化可重用的 xib?