I want to make a thing like Maps application. I've a UIScrollView with two views:
- [BACKGROUND] UIView with an image (suppose a pdf page)
- [OBJECTS LAYER] UIView on top (always inside the UIScrollView) where I want to draw/place some objects (ie UIImageVi开发者_运维问答ews with pins like in Google Maps)
Is possible to disable zoom for my second view. [OBJECTS LAYER] should not be zoomed and objects should remain at the same position (obviously the position is re-caculcated using the zoomScale of UIScrollView) and with the same size (no zoom should be applied). How can I accomplish it?
The solution is:
Place [OBJECTS LAYER] as direct child of UIScrollView
Set [OBJECTS LAYER] to be auto-resizable in width/height
- Recalculate position of objects inside (ie.pins) using the scale (newX=oldX*scale,newY=oldY*scale).
Hope it helps :)
精彩评论