Greg
Greg

Reputation: 1296

UIScrollView w/ zoom doesn't scroll until zoomed

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 doesn't do anything until the user pinches to zoom (even just one pixel). For example, the image might be 320 x 600, so they see a section 320 x 480, but would have to scroll to see the rest. However, the scrolling wouldn't work until they zoomed in or out. Is there any way to avoid this?

Upvotes: 5

Views: 2196

Answers (2)

Arjay Waran
Arjay Waran

Reputation: 433

Was stuck on this problem for almost a whole day. In the far right window, click on the far left button like soscreenshot

Then uncheck the "Use Autolayout"

Upvotes: 3

Conrad Shultz
Conrad Shultz

Reputation: 8808

Have you called -setContentSize: on the scroll view? If you haven't, it won't know that there is offscreen content to display.

Upvotes: 7

Related Questions