UIScrollView

I am using UIScrollView to scale an image. Although for reducing the image I want it to be able to be worn twice.

So my question is whether it is possible to zoom out with a double tap. (I can detect double click on zoomed view).

Which property can we use for this kind of scrolling.

Thanks in advance.

Regards, Vishal

+1


a source to share


3 answers


You probably want to use the UIScrollView method scrollRectToVisible:animated:

. You will pass it CGRect

which is the frame of the image contained in the scrollview. This will scroll (enlarge) the entire image so that it appears within the scrolling range.



+2


a source


There is an example in the docs, TapToZoom, check it out. This is a good example that will definitely answer your question.

To answer your question as someone else, we must use



[scroller zoomToRect:zoomRect animated:YES];

      

where zoomToRect is the rectangle you want to zoom into.

0


a source


I think you can also use

[yourScrollView setZoomScale:1.0 animated:YES];

      

to reduce the image and set it to normal scaling.

0


a source







All Articles