检查您的厦门国际银行委托的设置和代码,请按照下列:
![enter image description here](https://i.stack.imgur.com/Vbaa0.png)
记数细胞:
[_collectionView的registerClass:[UICollectionViewCell class] forCellWithReuse标识符:Cell_Identifier]。
而且直接看到API文档和演示: http://developer.apple.com/library/etc/redirect/xcode/ios/889e4b/samplecode/CollectionView-Simple/Introduction/Intro.html
新的截图和代码。
![enter image description here](https://i.stack.imgur.com/58ghK.png)
![enter image description here](https://i.stack.imgur.com/pD0Gf.png)
-(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout: (UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
{
UIEdgeInsets top = {10,25,15,25};
return top;
}
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section
{
CGSize size = {25,25};
return size;
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section
{
CGSize size = {25,25};
return size;
}
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
return CGSizeMake(70, 70);
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section
{
return 30;
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section
{
return 30;
}
是否将Delegate&DataSource添加到XIB中的UICollectionView? – iBhavin 2014-09-01 09:26:43
你需要像UICollectionView和XIB单元格一样的教程吗? – PREMKUMAR 2014-09-01 11:05:48
@iBhavin查看上面的截图。 collectionView连接到我的自定义UICollectionViewControl类的数据源和委托。这是自动设置的。但它不起作用。 – BadmintonCat 2014-09-01 11:42:33