From 2785a0bcd8f1b33c5378d8537ee349c758b04eec Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Sat, 4 Mar 2017 11:01:09 -0800 Subject: [PATCH] Pager should invalidate flow layout metrics on bounds change (#3133) --- Source/ASPagerFlowLayout.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/ASPagerFlowLayout.m b/Source/ASPagerFlowLayout.m index 86892c9033..a1de537a4b 100644 --- a/Source/ASPagerFlowLayout.m +++ b/Source/ASPagerFlowLayout.m @@ -101,4 +101,12 @@ return [super shouldInvalidateLayoutForBoundsChange:newBounds]; } +- (UICollectionViewLayoutInvalidationContext *)invalidationContextForBoundsChange:(CGRect)newBounds +{ + UICollectionViewFlowLayoutInvalidationContext *ctx = (UICollectionViewFlowLayoutInvalidationContext *)[super invalidationContextForBoundsChange:newBounds]; + ctx.invalidateFlowLayoutDelegateMetrics = YES; + ctx.invalidateFlowLayoutAttributes = YES; + return ctx; +} + @end