UIScrollView with scaling does not scroll to zoom

I have a UIScrollView loaded with a UIImageView so that the user can zoom in and then scroll if necessary. However, if the image is larger than the screen, scrolling does nothing until the user clicks (at least one pixel). For example, the image may be 320 x 600, so they see the 320 x 480 section, but you have to scroll to see the rest. However, scrolling will not work until they increase or disappear. Is there any way to avoid this?

+4
source share
2 answers

Did you call -setContentSize: on the scroll screen? If you have not done this, he will not know that off-screen content is displayed on the screen.

+6
source

Stuck in this problem for almost the whole day. In the rightmost window, click on the left button like this: screenshot

Then uncheck "Use self-timer"

+3
source

Source: https://habr.com/ru/post/1395983/


All Articles