원하는 상품이 Apple에 의해 작성되었습니다 PhotoScroller demo. 나는 그것을 사용했고 완벽하게 작동합니다.
특히 ImageScrollView 모듈을 확인하십시오. 확대/축소를 처리합니다.
여기 확대에 대해있는 UIScrollView의 헤더의 코드입니다 :
/*
the following properties and methods are for zooming. as the user tracks with two fingers, we adjust the offset and the scale of the content. When the gesture ends, you should update the content
as necessary. Note that the gesture can end and a finger could still be down. While the gesture is in progress, we do not send any tracking calls to the subview.
the delegate must implement both viewForZoomingInScrollView: and scrollViewDidEndZooming:withView:atScale: in order for zooming to work and the max/min zoom scale must be different
note that we are not scaling the actual scroll view but the 'content view' returned by the delegate. the delegate must return a subview, not the scroll view itself, from viewForZoomingInScrollview:
*/
@property(nonatomic) float minimumZoomScale; // default is 1.0
@property(nonatomic) float maximumZoomScale; // default is 1.0. must be > minimum zoom scale to enable zooming
왜 handlePinchGesture가 있습니까? 이 제스처는 스크롤보기에서 이미 처리되었습니다. –
무엇을 의미합니까? 그럼 내가 뭘해야 해? – Hosni