如何删除Iphone 6和iPhone 6plus中ios中Collection View Cell之间的空间?

pri*_*__y 4 objective-c ios uicollectionview

我有简单的CollectionView,但它运作良好,在iphone 45和5秒.但是当我在运行iphone 66plus它看起来像

在此输入图像描述

但我想删除iphone 6和之间的空格6 plus.是删除空间的属性?如果属性请告诉我.

Rah*_*tel 7

- (CGSize)collectionView:(UICollectionView *)collectionView
                  layout:(UICollectionViewLayout *)collectionViewLayout
  sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
    float width = collectionView.frame.size.width / 2;
    return CGSizeMake(width, width);

}
Run Code Online (Sandbox Code Playgroud)

对斯威夫特来说

func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize
{
    return CGSizeMake(collectionView.frame.size.width/2, collectionView.frame.size.width/2)
}
Run Code Online (Sandbox Code Playgroud)