删除collectionview中各节之间的空格 [英] Remove space between sections in collectionview
本文介绍了删除collectionview中各节之间的空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何调整集合视图各部分之间的间距。
How to adjust the spacing between sections of collection view.
推荐答案
可以通过调整集合视图布局的参数来调整标题高度。以下是相同的代码:
Header height can be adjusted by adjusting the params of the collection view layout. Following is the code for the same:
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
{
//{top, left, bottom, right}
if ([[sectionHeaderArray objectAtIndex:section] boolValue]) {
return UIEdgeInsetsMake(10, 10, 10, 10);
}
return UIEdgeInsetsZero;
}
这篇关于删除collectionview中各节之间的空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文