[英]How can I center UICollectionViewFlowLayout with two columns
I have a UICollectionView where I want this: 我有一个UICollectionView我想要的地方:
[ x x ]
[ x x ]
Each UICollectionViewCell is 120x120
using: 每个UICollectionViewCell的大小为120x120
使用:
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
return CGSizeMake(120, 120);
}
I cannot figure out how to make the two columns center. 我不知道如何使两列居中。 With the same amount in the left, middle and right. 在左,中和右具有相同的数量。
Can you help me out with this? 你能帮我这个忙吗?
Thanks! 谢谢!
Use sectionInset
to dictate the margins. 使用sectionInset
来指定边距。 Use minimumInteritemSpacing
to determine the space between the items. 使用minimumInteritemSpacing
确定项目之间的空间。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.