开发者

Zoom and marker

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜