title: UIScrollView AutoLayout Vertical Only
body: <p><strong>I want to get the AutoLayout working with the <code>UIScrollView</code> and am having a little trouble with it. Here is what I did:</strong></p>
  
  <ol>
  <li><p>Add a <code>UIScrollView</code> inside the Main View with frame: [top: 0, left: 0, width: 320, height: 568]</p></li>
  <li><p>Add <code>UIView</code> "ContentView" inside the <code>UIScrollView</code> with frame and bgcolor black: [top: 0, left: 0, width: 320, height: 568]</p></li>
  <li><p>Setup <code>UIScrollView</code> constraints: [top: 0, bottom: 0, left: 0, right: 0]</p></li>
  <li><p>Setup "ContentView" constraints: [top: 0, bottom: 0, left: 0, right: 0]</p></li>
  <li><p>Align the items inside the "ContentView"</p></li>
  <li><p>Set Main View bgcolor to gray (to see what's going on)</p></li>
  </ol>
  
  <p><strong>Here is a screenshot of the problem:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/Fi6g1.png" alt="Screen Shot"><a href="https://i.stack.imgur.com/Fi6g1.png" rel="noreferrer">1</a></p>
  
  <p>For some reason, the constraints make the content view be in the middle of the screen. Also, it scrolls in every direction. I want the content to be scrollable only in vertical direction like in <code>UITableView</code>. so that I can't move it like below:</p>
  
  <p><img src="https://i.stack.imgur.com/sn45z.png" alt="Screen Shot"></p>
  
  <p>What am I doing wrong? I have checked all the tutorials and answers I can find in StackOverflow and Google, and no one actually has just a bizarre problem, so I am asking for help.</p>
  
  <p><strong>EDIT:</strong> I also added ContentView's width and height as constraints and that didn't help either.</p>