默认情况下,创建集合视图时,项目将生成顶部和底部边距。
我想移动单元格位置。 (中间到底部) 有什么方法可以解决吗?
- (CGSize)collectionView:(UICollectionView *)collectionView
layout:(UICollectionViewLayout *)collectionViewLayout
sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
return CGSizeMake(collectionView.frame.size.width / 2.2, collectionView.frame.size.height-60);
}
答案 0 :(得分:2)
行。 更改集合视图流布局中的值。