Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 680
Greg Avatar asked Feb 11 '12 22:02

Greg


2 Answers

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

like image 98
Conrad Shultz Avatar answered Oct 17 '22 11:10

Conrad Shultz


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"

like image 43
Arjay Waran Avatar answered Oct 17 '22 11:10

Arjay Waran