chris antonopoulos chris antonopoulos -5 years ago 157
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 Source

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 :)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download