iOS的UITableViewCell里面的UICollectionView [英] iOS UICollectionView inside UITableViewCell
问题描述
我想实现一个包含几个图像的列表,就像下面的模型一样.每个部分中显示的图像数量是动态的,可能会有所不同.我还可以使部分中的所有图像始终可见(而不必水平或垂直滚动).
I want to implement a list containing several images grouped together like in the following mockup. The number of images to display in each section is dynamic and may vary. I also all images in a section to be always visible (without having to scroll horizontally or vertically).
实现此目标的最佳方法是什么?我使用UITableViewCell内的UICollectionView进行了一些测试,但无法根据内部图像的数量自动扩大UICollectionView/UITableViewCell的大小. 是使用UICollectionView/UITableViewCell还是更简单的方法?
What is the best approach to achieve this? I was making some tests with UICollectionView inside UITableViewCell but I can't make UICollectionView/UITableViewCell size expand automatically depending on the number of images inside. Is UICollectionView/UITableViewCell the way to go or is there a simpler approach?
推荐答案
您不需要UITableView即可实现此目的,这里是实现UICollectionView的Sticky Header的链接.
You don't need the UITableView to achieve this, here is the link for the implementation of Sticky Header for the UICollectionView.
https://gist.github.com/evadne/4544569
这篇关于iOS的UITableViewCell里面的UICollectionView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!