UIScrollView not respecting minimumZoomScale after changing the subview

自古美人都是妖i 提交于 2019-12-05 13:36:46

The problem seems to be - not sure if this behavior is documented somewhere - resetting the content size while the current zoom scale is set to something other than 1.0.

The fix is simple: Reset the zoomScale property to 1.0 before setting the new content size:

// See http://stackoverflow.com/questions/10586577
// first reset before new content size
scroller.zoomScale = 1.0f;
// set new content size
scroller.contentSize = newImage.size;
// ... adjust minimum/maximum zoom scales if needed
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!