4 images
Author
Description
SMScrollView
is a subclass of UIScrollView
with the following additions:
- It maintains the position of the view returned by its
delegate
'sviewForZoomingInScrollView:
in the center of its own boundaries. - It has a double-tap gesture to zoom in and out the view returned by its
delegate
'sviewForZoomingInScrollView:
. Specifically, when itszoomScale == minimumZoomScale
, it zooms-in the view to the tapped point and to the scale defined by by themaximumZoomScale
. Otherwise, whenzoomScale > minimumZoomScale
, it zooms-out to a scale defined by theminimumZoomScale
. The double-tap gesture is available through thedoubleTapGestureRecognizer
property to disable or adjust the gesture behavior. - When its size is changed, for example due to a change in an interface orientation, then:
- If its
fitOnSizeChange == YES
, then its content is rescaled to fit its new size, up to the scale of 1.0, such that the content is never stretched. - If
fitOnSizeChange == NO
, then it maintains zoomed view's center point in center after the size is changed. However, ifstickToBounds
property was set toYES
and the scroll-view was scrolled to one of its boundaries before the size change, then it is kept at these boundaries instead of keeping the center point in center.
- If its