底部选项卡栏上方的间隙-嵌入式NavigationController +嵌入式TableViewController

凯瑟琳·詹金斯

这个问题使我难过了几天。

这是与我相关的情节提要板布局:在此处输入图片说明我将所有阳光视图下的所有布局都设置为所有三个View Controller,并且仍然在“横幅”视图上方获得一个带有“间隙”的结果表视图-看起来与“横幅”视图的高度相同。如下:

在此处输入图片说明

起作用的一件事是将容器视图拖动到底部的横幅视图上,如下所示:

在此处输入图片说明

结果完美地呈现在我的测试设备以及每个模拟器上-即无间隙。

但是,这样的解决方案本质上是种黑客手段,我想看看是否有什么我可以做的才能正确解决此问题。

For the record, I have tried every option in the IB - adjust scroll view insets, extend edges under top/bottom bars, etc... as well as various code snippets I have googled here and there. Nothing seems to solve the issue for me.

I managed to solve the gap at the top of the table view under the nav bar (seemingly a common issue with a lot of content out there). But there does not seem to be so many cases like mine above.

Any help or indications are greatly appreciated. Thank you people :-)

* ADDITIONAL INFORMATION *

As per a comment below, I add the constraints I have tried for the said container:

在此处输入图片说明

Katherine Jenkins

OK. Essentially, with the kind assistant of @beyowulf I realised my current setup had to be changed.

I was

unnecessarily using a container view in your tabbarcontroller

as he correctly indicated

您的表格视图控制器无法推断它在tabbarviewcontroller中。

为了使表格视图控制器与容器视图的底部齐平,我不得不

直接将导航控制器嵌入tabbarviewcontroller中,并调整表格视图的底部插图。

我是通过顶部菜单栏项完成此操作的:

  1. 选择TableViewController
  2. 编辑器>嵌入--->标签栏控制器。

如果愿意,您可以轻松地将导航控制器合并到情节提要中,我也这样做。

方便的提示和我要解决的“差距”问题出现在底部的标签栏上方。

希望这对可能也会遇到相同问题的所有人有所帮助。

再次感谢@beyowulf。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章