[英]Custom UICollectionViewCell inside UICollectionView inside UITableViewCell programatically
我遵循了该教程: http ://ashfurrow.com/blog/putting-a-uicollectionview-in-a-uitableviewcell/在UITableViewCell内部实现UICollectionView。 如何在不使用情节提要的情况下以编程方式在UICollectionView内部实现自定义UICollectionViewCell? 我只需要在UICollectionViewCell中使用一个简单的UILabel。 任何帮助将不胜感激。
创建一个自定义UICollectionViewCell
,将其命名为CustomCell
,并实现方法initWithFrame
,您可以在其中将UILabel
添加到您的单元格中。
注册您的自定义UICollectionViewCell
[self.collectionView registerClass:[CustomCell class] forCellWithReuseIdentifier:CollectionViewCellIdentifier];
使cellForItemAtIndexPath
单元出cellForItemAtIndexPath
CustomCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CollectionViewCellIdentifier forIndexPath:indexPath];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.