Reputation: 6353
I have and UICollectionView and I want change programmatically the height of collectionView.
I'm using:
[self.myCollectionInStoryboard.collectionViewLayout collectionViewContentSize];
- (CGSize)collectionViewContentSize
{
return CGSizeMake([[UIScreen mainScreen] bounds].size.width, 800);
}
But it isn't work... I have added this to my viewController:
<UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>
How can I change this height property to my collectionView? Thanks!
Upvotes: 0
Views: 448
Reputation: 7370
That code does not do what you think it does. You can change the UICollectionView
's frame
property like so: self.myCollectionView.frame = CGRectMake(0,0,[UIScreen mainScreen] bounds].size.width, 800)
Upvotes: 3