I am creating my own flowlayout but I am having problems getting the correct collectionViewContentSize
, my data is an array of arrays, 5 arrays an each array have multiple items.
Is this correct numberOfItemsInSection:0
? or do i need check all the arrays to find the array that have more items and then calculate xSize with the items on that section ?
-(CGSize)collectionViewContentSize {
NSInteger xSize = [self.collectionView numberOfItemsInSection:0] * (itemWidth + space); // "space" is for spacing between cells.
NSInteger ySize = [self.collectionView numberOfSections] * (itemHeight + space);
NSLog(@"size %f, %f", xSize, ySize);
return CGSizeMake(xSize, ySize);
}
Thanks.