uiimageview 保留滚动视图缩放位置
我有一个滚动视图,其中 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过将 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.