1、首先創(chuàng)建一個(gè)類蕾总,繼承UICollectionViewCell粥航,將需要添加的子視圖加到initWithFrame方法里面
2、在viewDidLoad的時(shí)候注冊(cè)重用
[self.collectionView registerClass:[MyCollectionViewCell class] forCellWithReuseIdentifier:@"CELL"];
3生百、使用 MyCommentsCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"CELL" forIndexPath:indexPath];