简体   繁体   English

iOS Swift麻烦的详细信息页面带有嵌入式列表和集合视图

[英]iOS Swift trouble making detail page with embedded list and collection view

I am new in iOS development and Swift, I'm struggling creating a relatively simple detail page. 我是iOS开发和Swift的新手,正在努力创建一个相对简单的详细信息页面。
For now I have this layout made with interface builder: 现在,我已经使用界面生成器进行了以下布局: 在此处输入图片说明

The parts highlighted in red must have variable heights, every element is inside one big stack view which is inside a big scroll view. 以红色突出显示的部分必须具有可变的高度,每个元素都在一个大堆栈视图内,该视图在一个大滚动视图内。

The list of phone numbers is a label with Lines set at 0 so if I understood correctly that element will size itself correctly with the content. 电话号码列表是一个将Lines设置为0的标签,因此如果我正确理解该元素将根据内容正确调整其大小。

I don't know how to implement the other two lists and how to make the whole layout to wrap onto the content. 我不知道如何实现其他两个列表以及如何使整个布局包装到内容上。

To make you understand better I'm struggling because I'm used to make layouts in android and so making extensive use of the wrap_content option. 为了使您更好地理解,我正在努力,因为我习惯于在android中进行布局,因此大量使用wrap_content选项。



Thanks in advance 提前致谢

I think, you could use UITableView for image+text list and UICollectionView for images. 我认为,您可以将UITableView用于图像+文本列表,将UICollectionView用于图像。 If you are using constraints you have to add height constraints to your tableView and collectionView, but you could update those constraints from code with real heights. 如果使用约束,则必须在tableView和collectionView中添加高度约束,但是可以使用实际高度从代码中更新这些约束。

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

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