Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion TMQuiltView/TMQuiltView/TMQuiltView.m
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,9 @@ - (void)layoutSubviews {
// Harvest any any views that have moved off screen and add them to the reuse pool
for (NSIndexPath* indexPath in [indexPathToView allKeys]) {
TMQuiltViewCell *view = [indexPathToView objectForKey:indexPath];
if (![TMQuiltView isRect:view.frame partiallyInScrollView:self]) { // Rect intersection?
// the indexPathToView must has one indexPath,we should not remove all cell in quiltView,
// if *top == *bottom ,there is one cell in quitView ,so at this time,cell can not be removed
if (![TMQuiltView isRect:view.frame partiallyInScrollView:self] && indexPathToView.count > 1) { // Rect intersection?
[indexPathToView removeObjectForKey:indexPath];
// Limit the size on the reuse pool
if ([[self reusableViewsWithReuseIdentifier:view.reuseIdentifier] count] < 10) {
Expand Down