UICollectionView 使用

//定义每个UICollectionView 的 margin

-(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section

{

    return UIEdgeInsetsMake(0, 0, 0, 0);

}

 

#pragma mark --UICollectionViewDelegateFlowLayout

- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section{

    

    return 0;

    

}

 

- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{

    

    return 0;

    

}

调整UICollectionCell的自身与其他Cell的四周间隔,还有每列每行的最小间隔,特别是在使用横向滑动的时候,每个cell与cell间都有一条白色的竖行,当放回为零可以去掉。 

posted @ 2016-11-30 14:40  残梦未醒  阅读(111)  评论(0编辑  收藏  举报