繁体   English   中英

UICollectionView,单元格与导航栏重叠

[英]UICollectionView, cells are overlapped by Navigation bar

在此输入图像描述

想要删除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];

尝试在-viewDidLoad添加:

if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
    self.edgesForExtendedLayout = UIRectEdgeNone;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM