Skip to content

Commit eba2357

Browse files
committed
Don't show section headers whose size is zero
1 parent a203ac3 commit eba2357

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Classes/CSStickyHeaderFlowLayout.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,13 @@ - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect
151151
header = [self layoutAttributesForSupplementaryViewOfKind:UICollectionElementKindSectionHeader
152152
atIndexPath:[NSIndexPath indexPathForItem:0 inSection:indexPath.section]];
153153

154-
if (header) {
154+
if (!CGSizeEqualToSize(CGSizeZero, header.frame.size)) {
155155
[allItems addObject:header];
156156
}
157157
}
158-
[self updateHeaderAttributes:header lastCellAttributes:lastCells[indexPathKey]];
158+
if (!CGSizeEqualToSize(CGSizeZero, header.frame.size)) {
159+
[self updateHeaderAttributes:header lastCellAttributes:lastCells[indexPathKey]];
160+
}
159161
}];
160162
}
161163

0 commit comments

Comments
 (0)