gpt4 book ai didi

ios - NavigationBar 在运行时隐藏 View ,但不在 Interface Builder 中

转载 作者:行者123 更新时间:2023-12-01 18:59:11 26 4
gpt4 key购买 nike

我使用 Interface Builder 设置了一个 tableView 并在 TableView 上方放置了一个红色 View ,如下所示:

enter image description here

但是在运行时红色 View 被导航栏隐藏,所以我必须像这样使用自动布局设置一个约束:

enter image description here

但这不可能是正确的......我做错了什么?

我的帮助的更多信息:

enter image description here

最佳答案

这是因为 iOS7 允许在其下方显示 View 。您需要使用偏移量将 View 向下推到导航栏下方,就像您正在做的那样。您还可以通过取消选中将导航栏设置为不允许其下方的项目under top bars
enter image description here

如果您使用 xibs 而不是 Storyboard,请将其添加到您的 View Controller 中。
self.edgesForExtendedLayout = UIEdgeRectNone;

关于ios - NavigationBar 在运行时隐藏 View ,但不在 Interface Builder 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24064821/

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