0
我想以这种方式在UICollectionView中显示几个单元格:每个单元格就像一个页面给用户,而活动的UICollectionViewCell应该占据UICollectionView的全部边界。为什么UICollectionView单元格之间有黑色的差距?
然而由于种种原因,有向右移动后,细胞间黑差距。
它为什么会发生?
我已经定义了这个功能来控制的“页面”视图大小:
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
// the size is half of the screen
return CGSizeMake(self.view.bounds.size.width, self.view.bounds.size.height/2.0);
}
您是否将'sectionInset'和'minSpacing'设置为0.您需要在您使用的布局对象上设置它们。 – Fogmeister
看起来像minSpacing独自解决了我的问题。请将您的评论置于答案中,我会接受它。谢谢。 –