chris antonopoulos chris antonopoulos - 5 months ago 18
Swift Question

How change collectionView size or layout?

I have UITableView cell and i had nested UICollectionView. How change the height of the UICollectionView ?

Answer

Use this code change the frame size according to your need

- (CGSize)collectionView:(UICollectionView *)collectionView
                  layout:(UICollectionViewLayout *)collectionViewLayout
  sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{

    return CGSizeMake(collectionView.frame.size.width, collectionView.frame.size.height);
}

It works for me and i hope it works for you too :)