I have a scenario where I need to implement an Offline Map concept for which I am using the image of map on a UIScrollView
that zooms on PinchGesture, which works fine.
Problem
I have a UIButton
on map. While zooming, the button does not track its position with respect to UIImageView
which is being scaled.I am able to reframe the button without affecting its size. But the position is wrong.
TLDR,
I need to reproduce the mapView with annotation kinda concept on UIScrollView
with UIImage
on it. Can any one help?
Thanks in advance :)
If you know your current offset and zoom of your map, you should be able to compute the position of your button:
Try that, good luck
I have found the answer for this. I initially stored the button value in a CGRect initialButtonFrame. Then I updated the button frame (only origins, not the size of the button size as I wanted the button not to zoom like the image ie; I button should not zoom) using the scrollview delegate