2

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?

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.