title: View and its subviews disappearing after adding constraints
body: <p>I have a view (<code>addressLabelBackground</code>) at the top of my controller, underneath the navigation bar. It shows up fine in portrait mode, but I'm trying to get it to re-size when I turn the device to landscape mode. </p>
  
  <p>So I attempted to add some constraints in storyboard by pinning <code>addressLabelBackground</code> to the left of the view (0), right of the view (0) and the top to the navigation bar (0), but when I run the application, the view and all its subviews disappear.</p>
  
  <p>I also tried adding the constraints programmatically (like I did for the subviews), but again, <code>addressLabelBackground</code> and the subviews within disappear.</p>
  
  <p>Here's the code (in <code>viewDidLoad</code>):
  <strong>Updated after answer, got a crash</strong></p>
  
  <pre><code>    view.addSubview(addressLabelBackground)
      addressLabelBackground.addSubview(addressLabel)
      addressLabelBackground.addSubview(turnToTechLogo)
  
      addressLabelBackground.translatesAutoresizingMaskIntoConstraints = false
  
      addressLabelBackground.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
      addressLabelBackground.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
      addressLabelBackground.topAnchor.constraint(equalTo: (navigationController?.navigationBar.bottomAnchor)!).isActive = true
  
      addressLabel.font = UIFont.boldSystemFont(ofSize: 16.0)
      addressLabel.translatesAutoresizingMaskIntoConstraints = false
  
      addressLabel.centerXAnchor.constraint(equalTo: addressLabelBackground.centerXAnchor).isActive = true
      addressLabel.topAnchor.constraint(equalTo: addressLabelBackground.topAnchor).isActive = true
      addressLabel.bottomAnchor.constraint(equalTo: addressLabelBackground.bottomAnchor).isActive = true
  </code></pre>
  
  <p>The constraints for the addressLabel work perfectly fine in both portrait and landscape - it stays centered in the view. However when I try to add the constraints for <code>addressLabelBackground</code> the same way, or in storyboard, everything disappears.</p>
  
  <p>How can I get this view to stay pinned underneath the navigation bar, and stretch its width to fit the width of the screen, when the device is in landscape mode?</p>
  
  <p>EDIT (next day): Still trying to figure this out. I've tried making a subview called <code>innerContainer</code> and pinning it to the topAnchor of that:</p>
  
  <pre><code>    let frame = CGRect(x: 0, y: 20, width: self.view.bounds.width, height: self.view.bounds.height-20)
      let innerContainer = UIView(frame: frame)
  
      self.view.addSubview(innerContainer)
      innerContainer.addSubview(addressLabelBackground)
  
      addressLabelBackground.translatesAutoresizingMaskIntoConstraints = false
      addressLabelBackground.topAnchor.constraint(equalTo: innerContainer.topAnchor).isActive = true
  </code></pre>
  
  <p>But once again it disappears.</p>
  
  <p>I've also tried pinning it to the top (0 points) of the topLayoutGuide in storyboard, and it disappears then too.</p>