uiimageview 保留滚动视图缩放位置

发布于 2024-12-08 23:43:41 字数 240 浏览 3 评论 0原文

我有一个滚动视图,其中 uiimageview 表示为平铺层,它是一个静态地图。我有一个用于固定它的图像视图。当用户放大和缩小地图时,我需要图钉保留其位置,并按比例增加尺寸,以便在较小的缩放比例下仍然可见。我可以在谷歌地图中无缝地看到这一切的发生。当您缩小时,图钉的大小也会同时改变。 我尝试实现scrollviewdidbeginzoom和endzooming方法,当用户开始缩放时隐藏图钉并将其放回末尾重新计算的位置。但看起来并不优雅。任何指点都会有帮助,谢谢。

I have a scrollview with an uiimageview represented as a tiled layer, it is a static map. I have an imageview for pin over it. when the user zooms in and out of the map, I need the pin to retain its position, and also increase in size proportionately so that it is still visible at a smaller zoomscale. I can see this happening seamlessly in google maps. When you zoom out, the pin changes size at the same time.
I tried implementing the scrollviewdidbeginzoom and endzooming methods, hiding the pin when the user begins zoom and putting it back at a recalculated position at the end of it. But it does not appear elegant. Any pointers would be helpful, thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风情万种。 2024-12-15 23:43:41

我通过将 imageview pin 添加到最内层(photoscroller 应用程序中的 TilingView)的整个逻辑解决了这个问题。然后它会自动保持位置。我更改图像的大小,使其在某些缩放级别下更大。

I solved this by taking the whole logic of adding the imageview pin to the innermost layer(TilingView in the photoscroller app). It then automatically takes care of retaining position. I change the size of the image to make it bigger at certain zoom levels.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文