UICollectionViewCell更改位置

时间:2015-04-30 04:50:16

标签: ios objective-c uicollectionview uicollectionviewcell collectionview

enter image description here

默认情况下,创建集合视图时,项目将生成顶部和底部边距。

我想移动单元格位置。 (中间到底部) 有什么方法可以解决吗?

- (CGSize)collectionView:(UICollectionView *)collectionView
                  layout:(UICollectionViewLayout *)collectionViewLayout
  sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
    return CGSizeMake(collectionView.frame.size.width / 2.2, collectionView.frame.size.height-60);
}

1 个答案:

答案 0 :(得分:2)

enter image description here

行。 更改集合视图流布局中的值。