views:

639

answers:

1

I have uiimageviews as subviews for uiscrollview. I made my uiviewcontroller resize the scrollview contentsize and offset similar to how it was done here: http://github.com/andreyvit/ScrollingMadness/tree/master. The only difference is that I don't want my image views to take up the whole screen but try to stretch proportionally so I used

scrollView.contentMode = UIViewContentModeScaleAspectFit;

scrollView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;

view.contentMode = UIViewContentModeScaleAspectFit;

view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;

and a few other modifications. Now, the images are expanding proportionally and it looks fine without a nav bar but if I push the ScrollingMadnessController, it'll create a nav bar which will cause vertical scrolling.Is it even possible to disable the vertical scrolling?

A: 

As far as I know, vertical scrolling is disabled if the height of the scroll view's contentSize or the content in the scroll view does not exceed the frame's height of your scroll view. In other words, if this is the case there is no reason to allow for vertical scrolling (the same is true for horizontal scrolling obviously).

If you enable vertical bouncing, however, you still might get the impression that vertical scrolling is enabled, but you are not really scrolling content in this case.

bare_nature