title: Resizing a UICollectionView with layout constraints. Section headers move
body: <p>I have a UICollectionView between a number of other views, these are all laid out using constraints, where the collection view's heigh is the remaining space after all the heights of the other views and the gaps between them.</p>
  
  <p>Some times one of the views below the collection gets enlarged so the collection view gets shorter. </p>
  
  <p>This works as I expected except the position of the section headers(suplementary views) move up by the same amount as the view shrinks but the data cells remain in the same place. so that now the headers overlap the cells and there are gaps where they once were.</p>
  
  <p>This is fixed once they have been scrolled off screen or the device is rotated but I can't work out how to stop it happening </p>
  
  <p>edit:</p>
  
  <p>I just tried the other way round and increased the size of a view above the collection view now the cells move down when it shrinks and headers stay fixed.</p>
  
  <p>It appears that cells are positioned relative to the top of the view and headers relative to the bottom of the visible part of the view which is a bit strange.</p>