collectionview 边距 collectionViewCell圆角

来源:互联网 发布:2015药典 凡例平行数据 编辑:程序博客网 时间:2024/05/18 16:36

-(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;



0 0
原创粉丝点击