檢查您的廈門國際銀行委託的設置和代碼,請按照下列:
記數細胞:
[_collectionView的registerClass:[UICollectionViewCell class] forCellWithReuse標識符:Cell_Identifier]。
而且直接看到API文檔和演示: http://developer.apple.com/library/etc/redirect/xcode/ios/889e4b/samplecode/CollectionView-Simple/Introduction/Intro.html
新的截圖和代碼。
-(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