[英]How to layout with two container views with embedded tables
I am trying to layout the following UI View 我正在尝试布局以下UI视图
The Main UI View has two Container Views. 主UI视图有两个容器视图。 The top container view embeds a static table controller.
顶部容器视图嵌入了一个静态表控制器。 The bottom container view embeds another table controller which I want to be dynamic.
底部容器视图嵌入了另一个我想动态化的表控制器。
How can I set the layout so that the height of the top container view is equal to that of the top table, and the bottom container view gets the rest? 如何设置布局,以使顶部容器视图的高度等于顶部表的高度,而底部容器视图的高度得到其余部分?
Right now height is ambiguous for the container views. 现在,对于容器视图,高度是不明确的。
Constraint your top table view's height to some fixed value (it doesn't matter what). 将顶视图的高度限制为某个固定值(无关紧要)。
Make an outlet of that height constraint. 设置该高度限制的出口。
In your view controller, do this: 在您的视图控制器中,执行以下操作:
heightConstraint.constant = tableView.contentSize.height
this way bottom view will adjust accordingly. 这样,底视图将相应调整。
Make sure to disable bouncing in the top table view. 确保在顶表视图中禁用跳动。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.