【发布时间】:2018-07-31 06:20:05
【问题描述】:
现在,这是在 UITableView 中,假设它是 UITableViewCell。
我想做什么:-
1. Lets create a UICollectionView inside the UITableViewCell, this will have
3 rows. Every row will contain another UICollectionView where I will put
the data
FLow will be like this :-
UITableView -> UITableViewCell -> UICollectionView -> UICollectionViewCell -> UICollectionView -> UICollectionViewCell
2. create a UICollectionView inside the UITableViewCell, this will have
3 rows. Now I will create a view which contains data as whole and put it on cell. Height will be calculated programatically and view is put inside UICollectionViewCell
所以其他解决方案也是如此,但我对我脑海中的解决方案并不满意。
如果有人知道这样做的正确解决方案。让我知道。我更喜欢以更好的方式做事。
如果您需要更多详细信息,请告诉我
【问题讨论】:
-
如果数据是相关的,比如姓名和年龄,那么您可以在单个 uitableview 单元格中管理它。 Name 和 Age,将是一个 section header 中的两个不同标签,其他细节将是简单的 uitableviewcell。
-
不,不相关。
-
为什么要保留UITableView?您可以完全用 CollectionView 替换 tableView。然后,您可以为此特定单元格编写布局,以便将其呈现为网格。您可以将其他单元格呈现为全宽单元格
标签: ios iphone uicollectionview