UICollectionView sectionHeader and sectionFooter悬浮

 UICollectionViewFlowLayout *yLayout = [[UICollectionViewFlowLayout alloc] init];
    yLayout.sectionHeadersPinToVisibleBounds = YES;
    yLayout.sectionFootersPinToVisibleBounds = YES;

//return YES;表示一旦滑动就实时调用上面这个layoutAttributesForElementsInRect:方法
- (BOOL) shouldInvalidateLayoutForBoundsChange:(CGRect)newBound
{
    return YES;
}

 

posted @ 2018-04-24 19:41  神来钥匙-陈诗友  阅读(1445)  评论(0编辑  收藏  举报