UICollectionView,单元格与导航栏重叠

时间:2014-11-19 13:14:25

标签: ios objective-c uicollectionview uicollectionviewcell

enter image description here

想要删除collectionView单元格下面的空格:

UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
[flowLayout setItemSize:CGSizeMake(300, 435)];
[flowLayout setMinimumInteritemSpacing:0.0f];
[flowLayout setMinimumLineSpacing:20.0f];
[flowLayout setSectionInset:UIEdgeInsetsMake(0, 10, 0, 10)];

[flowLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal];

[self.collectionView setCollectionViewLayout:flowLayout];

1 个答案:

答案 0 :(得分:3)

尝试在-viewDidLoad

中添加此内容
if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
    self.edgesForExtendedLayout = UIRectEdgeNone;