Skip to content

Instantly share code, notes, and snippets.

@thomasdegry
Created December 2, 2014 17:26
Show Gist options
  • Save thomasdegry/e88bdc5f1d40c29363e6 to your computer and use it in GitHub Desktop.
Save thomasdegry/e88bdc5f1d40c29363e6 to your computer and use it in GitHub Desktop.
Delegate
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"fucked up collectionview is messing with me, width %f, two wide cells are %f, inner cells should be %f", self.collectionView.bounds.size.width, self.collectionView.bounds.size.width * 0.173333333, self.collectionView.bounds.size.width * 0.130666667);
if(indexPath.row % 7 == 0) {
NSLog(@"left");
return CGSizeMake(self.collectionView.bounds.size.width*0.173333333, 54);
} else if(indexPath.row % 7 == 6) {
NSLog(@"right");
return CGSizeMake(self.collectionView.bounds.size.width*0.173333333, 54);
} else {
NSLog(@"mid");
return CGSizeMake(self.collectionView.bounds.size.width*0.130666667, 54);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment