集合可重用视图未显示自定义布局

时间:2016-03-25 13:47:06

标签: ios uicollectionview uicollectionviewlayout uicollectionreusableview

我在开头创建了一个带有CollectionReusableView的UICollectionView并实现了所需的委托方法:

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section

- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath

通过执行此操作,正确显示了collectionView标头。但是当我将CollectionViewLayout更改为自定义(不是流布局)时,检测到问题,Header View不再显示。 在调试时,我看到没有调用委托方法viewForSupplementaryElementOfKind:atIndexPath:。

注意我使用RFQuiltLayout作为UICollectionView布局。

提前感谢您的帮助

0 个答案:

没有答案