Sorry this is super late... But maybe this will help people who haven't found an answer yet.
If you have your images in an array, you can simply reference the image size and make the adjustments to the cell size from there:
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
UIImage *image = [imageArray objectAtIndex:indexPath.row];
//You may want to create a divider to scale the size by the way..
return CGSizeMake(image.size.width, image.size.height);
}
Hope this helps..
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…