We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minimumColumnSpacing
Objective-C:
- (CGFloat)itemWidthInSectionAtIndex:(NSInteger)section { UIEdgeInsets sectionInset; if ([self.delegate respondsToSelector:@selector(collectionView:layout:insetForSectionAtIndex:)]) { sectionInset = [self.delegate collectionView:self.collectionView layout:self insetForSectionAtIndex:section]; } else { sectionInset = self.sectionInset; } CGFloat width = self.collectionView.bounds.size.width - sectionInset.left - sectionInset.right; NSInteger columnCount = [self columnCountForSection:section]; CGFloat columnSpacing = self.minimumColumnSpacing; if ([self.delegate respondsToSelector:@selector(collectionView:layout:minimumColumnSpacingForSectionAtIndex:)]) { columnSpacing = [self.delegate collectionView:self.collectionView layout:self minimumColumnSpacingForSectionAtIndex:section]; } return CHTFloorCGFloat((width - (columnCount - 1) * columnSpacing) / columnCount); }
Swift:
public func itemWidth(inSection section: Int) -> CGFloat { let columnCount = self.columnCount(forSection: section) let spaceColumCount = CGFloat(columnCount - 1) let width = collectionViewContentWidth(ofSection: section) return floor((width - (spaceColumCount * minimumColumnSpacing)) / CGFloat(columnCount)) }
In Swift version, collectionView:layout:minimumColumnSpacingForSectionAtIndex not be called in real time. minimumColumnSpacing for section not work.
The text was updated successfully, but these errors were encountered:
Add delegate method for minimumColumnSpacing
de37d0b
Fix chiahsien#207
Successfully merging a pull request may close this issue.
Objective-C:
Swift:
In Swift version, collectionView:layout:minimumColumnSpacingForSectionAtIndex not be called in real time. minimumColumnSpacing for section not work.
The text was updated successfully, but these errors were encountered: