Ios 自定义UICollectionViewCell内部UICollectionView内部UITableViewCell以编程方式
我遵循了教程:在UITableViewCell中实现UICollectionView。如何在UICollectionView中以编程方式实现自定义UICollectionViewCell而不使用情节提要?我只需要在UICollectionViewCell中添加一个简单的UILabel。任何帮助都将不胜感激Ios 自定义UICollectionViewCell内部UICollectionView内部UITableViewCell以编程方式,ios,objective-c,uicollectionview,uicollectionviewcell,Ios,Objective C,Uicollectionview,Uicollectionviewcell,我遵循了教程:在UITableViewCell中实现UICollectionView。如何在UICollectionView中以编程方式实现自定义UICollectionViewCell而不使用情节提要?我只需要在UICollectionViewCell中添加一个简单的UILabel。任何帮助都将不胜感激 创建一个自定义的UICollectionViewCell,命名为CustomCell,并实现方法initWithFrame,您可以在其中向单元格添加UILabel 注册您的自定义UIColle
UICollectionViewCell
,命名为CustomCell
,并实现方法initWithFrame
,您可以在其中向单元格添加UILabel
UICollectionViewCell
[self.collectionView注册表类:[CustomCell类]forCellWithReuseIdentifier:CollectionViewCellIdentifier]代码>
cellForItemAtIndexPath中的单元格出列
CustomCell*cell=[collectionView dequeueReusableCellWithReuseIdentifier:CollectionViewCellIdentifier forIndexPath:indexPath]代码>