title: Same constraints different results
body: <p>I gave a value of -8 to the &quot;bottom to Safe Area bottom&quot; constraints of 2 views, but they are not showing at the same distance from the Safe Area (seems like one needs -16 to equalize them).</p>
  <h3>What could be the issue?</h3>
  <p>Here's some code:</p>
  <pre class="lang-swift prettyprint-override"><code>    func addPlayerViews() { // called in viewDidLoad
          DispatchQueue.main.async {
              self.smallView.backgroundColor = .clear
              self.smallView.myLittleSubview.backgroundColor = .white
              self.smallView.myLittleSubview.layer.cornerRadius = 4
              self.smallView.myLittleSubview.layer.shadowColor = myShadowColor
              self.smallView.myLittleSubview.layer.shadowOffset = CGSize(width: 0.0, height: 3.0)
              self.smallView.myLittleSubview.layer.masksToBounds = false
              self.smallView.myLittleSubview.layer.shadowOpacity = 1.0
              self.smallView.myLittleSubview.layer.shadowRadius = 4
             
  
              self.bigView.backgroundColor = .white
              self.bigView.layer.cornerRadius = 4
              self.bigView.layer.shadowColor = myShadowColor
              self.bigView.layer.shadowOffset = CGSize(width: 0.0, height: -3.0)
              self.bigView.layer.masksToBounds = false
              self.bigView.layer.shadowOpacity = 1.0
              self.bigView.layer.shadowRadius = 4
  
              self.view.addSubview(self.smallView)
              self.view.addSubview(self.bigView)
  
              self.smallView.translatesAutoresizingMaskIntoConstraints = false
              self.bigView.translatesAutoresizingMaskIntoConstraints = false
  
              let safeArea = self.view.safeAreaLayoutGuide
  
              NSLayoutConstraint.activate([
                  self.smallView.leadingAnchor.constraint(equalTo: safeArea.leadingAnchor, constant: 4),
                  self.smallView.trailingAnchor.constraint(equalTo: safeArea.trailingAnchor, constant: -4),
                  self.smallView.bottomAnchor.constraint(equalTo: safeArea.bottomAnchor, constant: -8),
                  self.smallView.heightAnchor.constraint(equalToConstant: 48),
                  self.bigView.leadingAnchor.constraint(
                      equalTo: self.smallView.myLittleSubview.leadingAnchor, constant: 0),
                  self.bigView.trailingAnchor.constraint(equalTo: safeArea.trailingAnchor, constant: -4),
                  self.bigView.bottomAnchor.constraint(equalTo: safeArea.bottomAnchor, constant: -8),
                  // ☝️ not working as expected. See:  https://stackoverflow.com/q/62602071/5306470
                  self.bigView.heightAnchor.constraint(equalToConstant: 270)
              ])
  
  
              self.view.layoutIfNeeded() // must be at end of animation block, it seems
  
          }
  
      }
      
  </code></pre>
  <h1>Screenshot</h1>
  <ul>
  <li>Big view is blue and semi-transparent, myLittleSubview is orange, and smallView is <code>.clear</code></li>
  <li>iPhone 11 Pro Max (13.5)</li>
  </ul>
  <p><a href="https://i.stack.imgur.com/uHyy5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uHyy5.png" alt="screenshot" /></a></p>