0

I'm trying to do what is mentioned here:How to expand UICollectionView contentSize when paging enable?

All I want to do is override this method here so I could increase the collectionview content size. I'm assuming the rest should work fine because my custom layout, is inheriting from UICollectionViewLayout right?

- (CGSize)collectionViewContentSize
{    
    NSInteger itemCount = [self.collectionView numberOfItemsInSection:0];
    NSInteger pages = ceil(itemCount / 16.0);

    return CGSizeMake(320 * pages, self.collectionView.frame.size.height);
}

I made a custom UICollectionViewLayout and copy/paste the code of the first answer, but all I get is a blank page. I really have no idea of what I'm doing can someone show me how to properly Subclass and customize UICollectionViewLayout.

Community
  • 1
  • 1
user3296487
  • 326
  • 2
  • 12
  • If you're asking for help with code, you really need to provide the code in question. Otherwise, how can anyone do more than guess? – Caleb Feb 19 '15 at 19:47
  • Why don't you follow some manuals or something instead of copy-n-pasting some code and wondering WTF is going on. – pronebird Feb 19 '15 at 19:56
  • This is the code i copied from another person answer. Basically all I want to do is ovverride CollectionViewContentSize in my CustomCollectionViewLayout. But, i'm not sure if i have to rewrite all the code that the collectionView would run or how to do it. – user3296487 Feb 19 '15 at 19:56
  • I'm to lazy to be honest and I don't understand most guides – user3296487 Feb 19 '15 at 20:06

0 Answers0