[英]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.