Skip to content

Instantly share code, notes, and snippets.

@BradB132
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BradB132/0b1847ebb20d776a7786 to your computer and use it in GitHub Desktop.
Save BradB132/0b1847ebb20d776a7786 to your computer and use it in GitHub Desktop.
GettingStartedWithCustomUICollectionViewLayouts-4
-(UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath
{
UICollectionViewLayoutAttributes* attr = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath];
CGRect cellFrame = CGRectMake(/* calculate your origin x */,
/* calculate your origin y */,
/* calculate your width */,
/* calculate your height */);
attr.frame = cellFrame;
return attr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment