title: systemLayoutSizeFittingSize:UILayoutFittingCompressedSize doesn't compress
body: <p>I have problems with auto layout and the UITableView header (tableHeaderView) in iOS 8.X e iOS7.x.</p>
  
  <p>The <code>self.HeaderView</code> is a XIB built using auto layout. 
  It's used inside a scrollviewer followed by other views and the result is correct. </p>
  
  <p>Then I set it as header of a table view (as described <a href="https://stackoverflow.com/questions/16471846/is-it-possible-to-use-autolayout-with-uitableviews-tableheaderview">here</a>):</p>
  
  <pre><code>self.tableView.tableHeaderView = self.HeaderView;
  [self.HeaderView setNeedsLayout];
  [self.HeaderView layoutIfNeeded];
  CGSize headerViewSize = [self.HeaderView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];
  CGRect frame = self.HeaderView.frame;
  frame.size.height = headerViewSize.height;
  self.HeaderView.frame = frame;
  self.tableView.tableHeaderView = self.HeaderView;
  </code></pre>
  
  <p>but the resulted height is bigger than expected. I can't understand why. Constraints seem to be ok otherwise why in the scrollview the result is correct?</p>
  
  <p>If in the IB I resize the height of the container frame the constraints are updated without any ambiguity.</p>
  
  <p>Why the <code>UILayoutFittingCompressedSize</code> doesn't compress the view?</p>
  
  <p><strong>#update</strong></p>
  
  <p>I discovered the problem. Basically the constraints are correct. </p>
  
  <p>After layoutSubviews has been called the UIImageView is correctly sized. Width and height are as expected. 
  The problem is in the way <code>systemLayoutSizeFittingSize:UILayoutFittingCompressedSize</code> works. </p>
  
  <p>Instead of calculating the size using the UIImageView size (which has been correctly resized), it uses the size of UIImage (which source file is bigger)</p>
  
  <p>So, what can I do to force <code>systemLayoutSizeFittingSize:UILayoutFittingCompressedSize</code> to calculate the size using the UIImageView size??</p>