I am using a UICollectionView programmatically.
I\'ve set its frame as follows:
UICollectionView *collectionView = [[UICollectionView alloc] initWithFram
Setting the height of the UICollectionView
to 3000 will make your scrolling problem worse. If the UICollectionView
is 3000 pixels tall then it will only ever need to scroll if it has more than 3000 pixels worth of content in it. You should set it to the height of the view it is contained in (same as the width).
AFAIK the also should not set the contentSize
directly, instead you need to override the - (CGSize)collectionViewContentSize
method in a subclass of UICollectionViewLayout
, but generally speaking you shouldn't need to change the content size for normal uses.
I'm not totally clear on what your problem is - is it that when you add more than a screens worth of items you can't scroll?