I have setup a UICollectionView in interface builder with:
Frame is 320x180 Cell size is 320x180 Flow Layout cell size is 320x180 Insets are all at 0
Yet, somehow, when my iniWithFrame method is called, it's getting me a smaller height. 160! And not 180.
My custom Cell is also 320x180;
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
self = [[[NSBundle mainBundle] loadNibNamed:@"FSGalleryCell" owner:self options:nil] objectAtIndex:0];
}
return self;
}
Not only that, the UICollectionView Y origin is showing about 50 points lower than it is in interface builder.
I don't have any constraints set. I have tried to disable Auto Layout.
Also if I try to manually do this: cell contents don't show.
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
return CGSizeMake(320, 180);
}
Only If I leave it like this:
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
return self.collectionView.frame.size;
}
I'm expecting the last one to work because it's 320x160. Anything bigger and it won't show.
Everything is working fine in iOS7. It's iOS6 that these problems show up.
All help is greatly appreciated!!