views:

205

answers:

1

I'm having a problem with the UIScrollView when doing zooming operations, which seems to be very simple but I didn't figured out how to solve it.

I want an UIScrollView no to exceed the bounds of the content view when zooming out. By reading the Reference Guide i found out the following properties:

  • bounces (A Boolean value that controls whether the scroll view bounces past the edge of content and back again.)
  • bouncesZoom (A Boolean value that determines whether the scroll view animates the content scaling when the scaling exceeds the maximum or minimum limits.)
  • alwaysBounceVertical (A Boolean value that determines whether bouncing always occurs when vertical scrolling reaches the end of the content.)
  • alwaysBounceHorizontal (A Boolean value that determines whether whether bouncing always occurs when horizontal scrolling reaches the end of the content view.)

What these properties actually do is to define what the scroll view should do when the it exceeds the content view (zooms out too much). It tried setting the property:

  • minimumZoomScale (A floating-point value that specifies the minimum scale factor that can be applied to the scroll view's content.)

to 1.0 (which I guess is the default value), and as expected, the scroll view does it, but it still exceeding the bounds of the content view for a while (bouncing back to the minimum scale).

How can I avoid this? May be some kind of combination of the above properties might work, but I'm still be bit confused about this.

Thanks in advance.

+2  A: 

Set bouncesZoom to false. This should prohibit zooming pass the minimum zoom value.

Shawn