title: problem with zoom in UIScrollView on iOS 4.0
body: <p>This is a general question to a specific problem.</p>
  
  <p>I am using a UIScrollView in an app that displays photographs. on iOS &lt; 4.0, zooming works great. the same app running on iOS 4.0.x has problems zooming. specifically, if the image does not fill the view (and black bands appear at top/bottom), the first zoom is jerky and garbage data is shown on the bottom of the screen.</p>
  
  <p>the source code to analyze is way to complex and spread out to adequately share here. Can anyone suggest any areas to look at that might cause this strange behavior?</p>
  
  <p>thanks!
  Mark</p>
  
  <p>edit: here's the code from the double tap handler (borrowed from the tapDetectingImageView sample code):</p>
  
  <pre><code>- (void)tapDetectingImageView:(TapDetectingImageView *)view gotDoubleTapAtPoint:(CGPoint)tapPoint {
      // double tap zooms in
      float newScale = [self zoomScale] * ZOOM_STEP;
      CGRect zoomRect = [self zoomRectForScale:newScale withCenter:tapPoint];
      [self zoomToRect:zoomRect animated:YES];
  }
  </code></pre>
  
  <p>I can force the weirdness if I change the animated parameter in the call to zoomToRect. when animated is NO, my image becomes 2 images superimposed one on top of the other. the bottom image is the original zoom level, the top image is the new zoom level. if I swipe the screen to pan, the image is refreshed. It's almost as if a call to layoutSubviews or DrawRect is not getting called.</p>