title: UIView in UIScrollView respects some constraints but not other
body: <p>I need to add a containerView inside a <code>UIScrollView</code>, and then add multiple subviews in the containerView.  For some reason, the containerView does not respect the <code>top/bottom/left/rightAnchor</code> constraints, but it works with <code>width/height/centerX/centerYAnchor</code></p>
  
  <p><strong>NOTE:</strong> If the superview is a <code>UIView</code> instead of a <code>UIScrollView</code>, it works fine.</p>
  
  <p>The project is 100% code based. Using Swift 4.1 and Xcode 9.4</p>
  
  <p><strong>This does not work</strong></p>
  
  <pre><code>containerView.topAnchor.constraint(equalTo: scrollView.topAnchor, constant: 0).isActive = true
  containerView.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor, constant: 0).isActive = true
  containerView.leftAnchor.constraint(equalTo: scrollView.leftAnchor, constant: 0).isActive = true
  containerView.rightAnchor.constraint(equalTo: scrollView.rightAnchor, constant: 0).isActive = true
  </code></pre>
  
  <p><strong>This works</strong></p>
  
  <pre><code>containerView.widthAnchor.constraint(equalTo: scrollView.widthAnchor).isActive = true
  containerView.heightAnchor.constraint(equalTo: scrollView.heightAnchor).isActive = true
  containerView.centerXAnchor.constraint(equalTo: scrollView.centerXAnchor).isActive = true
  containerView.centerYAnchor.constraint(equalTo: scrollView.centerYAnchor).isActive = true
  </code></pre>
  
  <p>In both cases the <code>scrollView.constraints</code> array includes 4 constraints total.</p>
  
  <p>The interesting thing is that the printout of them is different. Some of the constraints that don't work (.<code>top</code> and .<code>left</code>) are printed using the <em>Autolayout Visual Format Language</em>. Also, note the (LTR) in the third one:</p>
  
  <pre><code>ScrollView [
  &lt;NSLayoutConstraint:V:|-(0)-[UIView] (active, names: '|':UIScrollView:)&gt;,
  &lt;NSLayoutConstraint:UIView.bottom == UIScrollView.bottom (active)&gt;,
  &lt;NSLayoutConstraint:H:|-(0)-[UIView](LTR) (active, names: '|':UIScrollView:)&gt;,
  &lt;NSLayoutConstraint:UIView.right == UIScrollView.right (active)&gt;]
  </code></pre>
  
  <p>The constraints that work are printed as follows:</p>
  
  <pre><code>ScrollView [
  &lt;NSLayoutConstraint:UIView.width == UIScrollView.width (active)&gt;,
  &lt;NSLayoutConstraint:UIView.height == UIScrollView.height (active)&gt;, 
  &lt;NSLayoutConstraint:UIView.centerX == UIScrollView.centerX (active)&gt;, 
  &lt;NSLayoutConstraint:UIView.centerY == UIScrollView.centerY (active)&gt;]
  </code></pre>
  
  <p>I researched StackOverflow and found a couple of questions like <a href="https://stackoverflow.com/questions/48708331/views-in-scrollview-doesnt-respect-constraints">this</a>, but they didn't really help me explain what the problem is (or the <code>UIScrollView</code> requirements for constraints).</p>
  
  <p>Any ideas?</p>