I'm fairly new to UICollectionView. Though I've watched the WWDC talks on it I'm still unclear how to achieve my layout. I'm trying to constrain my flow layout to a square bottom aligned to the window's rootviewcontroller
(see image). However, when setting UIEdgeInsetsMake(200, 10, 10, 10)
which as I understand should compress only the top portion of the flow layout, instead what happens is the flow layout is compressed from top and bottom. Additionally, I'm not sure how to use -(NSArray *)layoutAttributesForElementsInRect:(CGRect)rect
or -(CGSize)collectionViewContentSize
to create this layout.
-(id)init
{
self = [super init];
if (self) {
self.scrollDirection = UICollectionViewScrollDirectionHorizontal;
self.itemSize = CGSizeMake(75, 75);
self.sectionInset = UIEdgeInsetsMake(100, 10, 10, 10);
}
return self;
}
What my results are:
What I'm trying to acheive: