![](https://img.haomeiwen.com/i1286371/a7c4602b6e037d30.png)
![](https://img.haomeiwen.com/i1286371/b940b9ed3fc8856f.png)
![](https://img.haomeiwen.com/i1286371/3a27cb8dd59b1efa.png)
![](https://img.haomeiwen.com/i1286371/85d014edcb2e3031.png)
以上是VC中主要代码,有坑的地方:
1.[self.collectionViewregisterNib:[UINibnibWithNibName:@"WhiteBarPaymentCollectionViewCell"bundle:[NSBundlemainBundle]]forCellWithReuseIdentifier:@"WhiteBarPaymentCollectionViewCell"];
如果是用XIB 自定义的cell,这行代码不可或缺
//[self.collectionView registerClass:[WhiteBarPaymentCollectionViewCell class] forCellWithReuseIdentifier:@"WhiteBarPaymentCollectionViewCell"];
这行代码不可打开。
2.cell.backgroundColor= [UIColorwhiteColor];
开始没设置这行代码,cell一直显示不出来。
网友评论