title: How to constrain uicollectionviewflowlayout to a specified frame
body: <p>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 <code>rootviewcontroller</code> (see image). However, when setting <code>UIEdgeInsetsMake(200, 10, 10, 10)</code> 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 <code>-(NSArray *)layoutAttributesForElementsInRect:(CGRect)rect</code> or <code>-(CGSize)collectionViewContentSize</code> to create this layout. </p>
  
  <pre><code>-(id)init
  {
      self = [super init];
      if (self) {
          self.scrollDirection = UICollectionViewScrollDirectionHorizontal;
          self.itemSize = CGSizeMake(75, 75);
          self.sectionInset = UIEdgeInsetsMake(100, 10, 10, 10);
      }
      return self;
  }
  </code></pre>
  
  <p>What my results are:
  <img src="https://i.stack.imgur.com/lRbGv.png" alt="enter image description here"></p>
  
  <p>What I'm trying to acheive:
  <img src="https://i.stack.imgur.com/Dz27m.png" alt="enter image description here"></p>