//定义每个UICollectionView 的大小
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
return [self getCollectionCellSize_180x180];
}
- (CGSize)getCollectionCellSize_180x180
{
return CGSizeMake((self.frame.size.width - 11)/3, (self.frame.size.width - 11)/3);
}
//缩进 设置collection view 的每个section与上下左右的距离
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{
return UIEdgeInsetsMake(0, 0, 0, 0);
}