title: button stackView spacing not working -Swift - Programmatically
body: <p>I'm adding a stackView in my viewcontroller in this way:</p>
  <pre><code>addSubview(stackView)
      stackView.translatesAutoresizingMaskIntoConstraints = false
      stackView.anchor(top: nameLabel.bottomAnchor, leading: leadingAnchor, bottom: bottomAnchor, trailing: trailingAnchor)
      
      
      let emotionsButton = EmotionButton()
      emotionsButton.translatesAutoresizingMaskIntoConstraints = false
      let contentButton = ContentsButton()
      contentButton.translatesAutoresizingMaskIntoConstraints = false
      
      
      
      stackView.axis = .horizontal
      stackView.alignment = .center
      stackView.distribution = .equalCentering
      stackView.spacing = 8
      
      stackView.addArrangedSubview(emotionsButton)
      stackView.addArrangedSubview(contentButton)
      
      emotionsButton.widthAnchor.constraint(equalToConstant: 91).isActive = true
      contentButton.widthAnchor.constraint(equalToConstant: 91).isActive = true
      
      emotionsButton.heightAnchor.constraint(equalToConstant: 83).isActive = true
      contentButton.heightAnchor.constraint(equalToConstant: 83).isActive = true
  </code></pre>
  <p>but the result I get is not the desired one; this is what I want:</p>
  <p><a href="https://i.stack.imgur.com/Ci7L3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ci7L3.png" alt="Stack Desired" /></a></p>
  <p>This is what I get:</p>
  <p><a href="https://i.stack.imgur.com/t0WpF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t0WpF.png" alt="Stack I get" /></a></p>