简体   繁体   English

如何自动布局滚动视图使其适合内容视图?

[英]How to auto layout Scroll View fit with content View inside it?

I want to build post-comment interface like facebook. 我想建立评论后的界面,例如facebook。 In storyboard scene, the superView has 2 parts (Content View and Comment Section). 在情节superView场景中, superView有2个部分(Content View和Comment部分)。 Content View contains the scrollView which has all of the elements inside it, include the tableView which shows user comments. 内容视图包含scrollView ,其中包含所有元素,还包括显示用户评论的tableView My problem is that i dont know how to auto layout scrollView to fit with it's content inside. 我的问题是我不知道如何自动布局scrollView使其适合内部的内容。 Please show me how to do ? 请告诉我该怎么做? Thank for your helping !!! 感谢您的帮助!

在此处输入图片说明

您使用的方法之一是在Controller swift文件中为容器视图的高度限制设置出口,并通过计算帖子的高度+显示的评论数*评论的高度来更新它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM