将tableView安装到其父UIViewController中

时间:2016-01-20 03:48:08

标签: ios xcode swift uitableview

我使用Storyboard将TableView放入我的ViewController中,我希望它在没有任何边距的情况下填充,例如下图中带有TableView的较低ViewController。

enter image description here

我在其他类似问题的答案中尝试了一些建议,但根本没有用。

有人说我需要设置PIN码。我尝试过如下:

enter image description here

我为所有4个约束输入'0',但这就是我得到的:

enter image description here

这个AutoLayout让我很难自动布局,不像它的名字。

我现在该怎么办?

2 个答案:

答案 0 :(得分:3)

单击“更新框架”后,单击“解决自动布局问题”,如下图所示。

enter image description here

答案 1 :(得分:2)

在文档大纲中,点击黄色箭头: enter image description here

点击黄色三角形: enter image description here

然后选择Update FramesFix Misplacemententer image description here

这将解决错位的视图。或者,您可以在指定约束之前调整表视图的大小。

我建议您查看自动布局教程,例如link

相关问题