-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section{}
这个方法只提供设置cell之间的距离,最左边的cell和最右边的cell到superview的间距却不能设置。
这样有两种方法来设置
1.改变collectionview的大小
2.设置flowLayout
flowLayout.sectionInset =UIEdgeInsetsMake(0,10,0,10);
collectionVIewCell圆角的设置
cell.contentView.layer.cornerRadius =10;
cell.layer.cornerRadius =10;
cell.contentView.layer.masksToBounds =YES;
本文介绍了如何在iOS开发中使用UICollectionView,详细讲解了设置cell间间距的方法及collectionView视图边缘间距调整技巧,并演示了如何为UICollectionViewCell添加圆角。
666

被折叠的 条评论
为什么被折叠?



