I have UIScrollView with UIImageView on it. On UIImageView I have round marker(one more UIImageView), which I can drag on UIImageView. I want to zoom my image on UIImageView, so:
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return imageV开发者_Python百科iew;
}
But when user is trying to zoom image my marker is zooming too. But I want to see my marker in its original size. How can I do it?
You can apply reverse zooming transform to your marker in delegate's method:
- (void) scrollViewDidEndZooming: (UIScrollView *) aScrollView withView: (UIView *) view atScale: (float) scale{
marker.transform = CGAffineTransformMakeScale(1.0f/scale, 1.0f/scale);
}
Or in scrollViewDidZoom:
method - depending on which one will give better behaviour for you
精彩评论