title: iOS SDK UIViewContentModeScaleAspectFit vs. UIViewContentModeScaleAspectFill
body: <p>I have an image that I would like to display in a <code>UITableViewCell</code> using the <code>UITableViewCellStyleSubtitle</code> style that provides a <code>UIImageView</code>, and two lines of text, plus an optional accessory view. </p>
  
  <p>However, when I set the content mode of the <code>UIImageView</code> to either of <code>UIViewContentModeScaleAspectFit</code> or <code>UIViewContentModeScaleAspectFill</code>, it appears to make no difference. Both of these content modes simply display the entire image, shifting the text to the right to make room for the image.</p>
  
  <p>Does anyone have any examples of how these actually differ in practice? The docs say:</p>
  
  <pre><code>UIViewContentModeScaleAspectFit:
  Scales the content to fit the size of the view by maintaining the aspect ratio. Any     remaining area of the view’s bounds is transparent.
  
  UIViewContentModeScaleAspectFill:
  Scales the content to fill the size of the view. Some portion of the content may be  clipped to fill the view’s bounds.
  </code></pre>
  
  <p>But these content modes don't appear to be behaving as advertised.</p>
  
  <p>EDIT: I'm running SDK iOS 4.</p>