我刚刚开始使用 UICollectionView,所以请耐心等待!
如何将笔尖加载到单元格中?
看来我必须注册要使用的笔尖和类,但这不起作用。
代码:
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
[collectionView registerClass:[CluelessSymbolCell class] forCellWithReuseIdentifier:@"Symbol cell"];
[collectionView registerNib:[UINib nibWithNibName:@"CluelessSymbolCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"Symbol cell"];
CluelessSymbolCell *cell = (CluelessSymbolCell *)[collectionView dequeueReusableCellWithReuseIdentifier:@"Symbol cell" forIndexPath:indexPath];
CluelessClue *clue = [clueManager clueForIndexPath:indexPath];
[cell.backgroundImageView setImage:[UIImage imageNamed:[clue.imageNames objectAtIndex:0]]];
return cell;
}