gpt4 book ai didi

ios - 来自 XIB 的 UIViewController 没有调整到 UINavigationBar

转载 作者:行者123 更新时间:2023-11-28 21:26:45 25 4
gpt4 key购买 nike

我在单独的 xib 中创建了 MyViewController 并将其推送到导航堆栈。它已正确加载并调整大小,但隐藏在显示的导航栏下方(绿色按钮隐藏): enter image description here在 xib 中,我将顶部栏的所有选项设置为推断:

enter image description here

我该如何解决?当然我可以在 xib 中手动添加间距,但这不是正确的方法。

编辑:在 xib 的属性中,我没有看到顶部栏勾号下的扩展,因为在 xib 中我创建了 UIView,文件所有者设置为 MyViewController。

enter image description here

enter image description here

最佳答案

因为是半透明的。你应该这样做。

self.navigationController?.navigationBar.isTranslucent = false

您会看到它有效。当导航栏不是半透明时,xib 无法定位到导航栏后面显示它有什么。

关于ios - 来自 XIB 的 UIViewController 没有调整到 UINavigationBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37854951/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com