I'm adding a stackView in my viewcontroller in this way:
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
but the result I get is not the desired one; this is what I want:
This is what I get: