How to scroll and zoom in/out large images on iPhone?

若如初见. 提交于 2019-12-21 20:17:37

问题


I have a large image, size around 30000 (w) x 6000 (h) pixels. You may consider it's like a big map. I assume I need to crop it up into smaller tiles. Questions:

  • what are the right ViewControllers to use?
  • (link) what is the tile strategy? (I put this in another question, as it's not iPhone specific)

Requirements:

  • whole image (though cropped) can be scrolled up/down/left/right by swipes
  • zoom in (up to pixel-to-pixel) out (down to screen-fit-by-height) by the 2-finger operation
  • memory efficiency by lazy loading tiles

Bonus requirements:

  • automatic scroll, say from left to right slowly and smoothly

Thanks!


回答1:


Check out part 3 of Apple's ScrollViewSuite sample code for an example of how to do this.



来源:https://stackoverflow.com/questions/2726336/how-to-scroll-and-zoom-in-out-large-images-on-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!