UICollectionView设置item(cell)之间间距为0(紧挨在一起的效果)
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
self.layout = layout;
// 设置每格的大小
layout.itemSize = CGSizeMake(DD_SCREEN_WIDTH * 0.5, 80);
// 上左下右间距
layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0);
layout.minimumLineSpacing = 0;
layout.minimumInteritemSpacing = 0;
return [self initWithCollectionViewLayout:layout];
注意: minimumInteritemSpacing, sectionInset这两个属性是关联的, 必须设置准确