diff --git a/NHAlignmentFlowLayout/NHAlignmentFlowLayout.m b/NHAlignmentFlowLayout/NHAlignmentFlowLayout.m index 62ca981..515d1de 100644 --- a/NHAlignmentFlowLayout/NHAlignmentFlowLayout.m +++ b/NHAlignmentFlowLayout/NHAlignmentFlowLayout.m @@ -144,7 +144,7 @@ -(UICollectionViewLayoutAttributes *)layoutAttributesForBottomAlignmentForItemAt return attributes; } - if (indexPath.item == [self.collectionView numberOfItemsInSection:indexPath.section]) { + if (indexPath.item == [self.collectionView numberOfItemsInSection:indexPath.section] - 1) { frame.origin.y = self.collectionViewContentSize.height - self.sectionInset.bottom - frame.size.height; } else { NSIndexPath *nextIndexPath = [NSIndexPath indexPathForItem:indexPath.item + 1 inSection:indexPath.section];