UICollectionView sectionHeader and sectionFooter悬浮

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

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

猜你喜欢

转载自www.cnblogs.com/shenlaiyaoshi/p/8933198.html