title: Xcode Imageview Aspect Fit Remove Extra Space
body: <p>I have an imageview inside a UITableViewCell. </p>
  
  <p>Imageview with Aspect Fit creates a lot of extra space in the top and bottom if the image is large. The extra space (gray background color) is shown in the picture below. </p>
  
  <p>How do I remove the extra space?</p>
  
  <p><a href="https://i.stack.imgur.com/9XO1J.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9XO1J.png" alt="Imageview Extra Space"></a> 
  <br />A few notes: </p>
  
  <ol>
  <li><p>This particular image is 890 x 589 and the screenshot was taken on a iphone 6S simulator.</p></li>
  <li><p>I am using UITableViewAutomaticDimension for automatic table cell height. </p></li>
  <li><p>There is no height constraint on the imageview so it can resize accordingly.</p></li>
  </ol>
  
  <p>Thank you in advance.</p>