Search code examples
autolayoutscrollviewios9size-classes

Issue with adding Scroll View with Autolayout


I have followed many accepted answers and many tutorials to know the way to add scroll view with Auto Layout but none of them helped me. Thus, I am now posting that as a question.

The common thing I found in the answers and tutorial is that none of them used Navigation Bar and the content which they are showing can come within the bounds of the screen but we need to scroll when content can't come within the bounds of screen. I have shared the image along with this question and my question is how can I show this on Scroll view on iPhone 5 screen with the help of Auto Layout.

enter image description here

I am working on an iPad Application and I have set the following constraints.

Please see them in an image below:

enter image description here


Solution

  • try this constraints...

    For topbar

      pinned all 4 edges 
      and give height constraint  
    

    For scrollview

     pinned all 4 edges  
    

    For View inside scrollview

    pinned all 4 edges
    equal width to superview
    and height constraint