Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为这个问题找到一个可行的解决方案是一件很痛苦的事情。在一个视图中,我有大约五个滚动视图,最大缩放为 5 。我想要的是,如果用户放大了图像的特定区域,然后返回,滚动视图将图像设置在它离开的任何地方。我试过使用内容偏移和内容插入属性,但这没有帮助。
您需要做的就是将滚动视图的contentOffset属性值和 zoomScale.
contentOffset
zoomScale
当您想将滚动视图移回该位置时,您只需执行
[myScrollView setZoomScale:lastZoomScale]; [myScrollView setContentOffset:lastContentOffset];