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
JBSpacerOption *option = [JBSpacerOption optionWithItemSize:90.0f minimumGutter:1.0f gutterToMarginRatio:1.0f availableSize:self.view.frame.size.width distributeExtraToMargins:YES]; JBSpacer *spacer = [JBSpacer spacerWithOption:option]; // use dispatch_after to see the effect of the spacer dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [spacer applySpacingToCollectionViewFlowLayout:self.flowLayout]; });
self.view.frame.size.width => 320.0f
self.view.frame.size.width
320.0f
The text was updated successfully, but these errors were encountered:
My guess is that self.view.frame.size.width is greater than 320.0, and that would cause your result.
Sorry, something went wrong.
Even when I hardcode 320.0f as availableSize the outcome is the same.
availableSize
JBSpacerOption *option = [JBSpacerOption optionWithItemSize:90.0f minimumGutter:1.0f gutterToMarginRatio:1.0f availableSize:320.0f distributeExtraToMargins:YES]; JBSpacer *spacer = [JBSpacer spacerWithOption:option];
The problem was my collection view was not constrained by the parent view.
No branches or pull requests
Code:
Result:
Variable values
self.view.frame.size.width
=>320.0f
The text was updated successfully, but these errors were encountered: