缩放和标记
我有 UIScrollView 和 UIImageView 。在 UIImageView 上,我有圆形标记(又一个 UIImageView),我可以将其拖动到 UIImageView 上。我想在 UIImageView 上缩放图像,所以:
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return imageView;
}
但是当用户尝试缩放图像时,我的标记也在缩放。但我想看到我的标记的原始大小。我该怎么做呢?
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 imageView;
}
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在委托方法中将反向缩放变换应用于标记:
或在
scrollViewDidZoom:
方法中 - 取决于哪一个将为您提供更好的行为You can apply reverse zooming transform to your marker in delegate's method:
Or in
scrollViewDidZoom:
method - depending on which one will give better behaviour for you