Closed NWilliamsonWalsh closed 5 years ago
Hey @NWilliamsonWalsh is there any chance that you aren’t calling the button to LayoutIfNeeded()
?
@NWilliamsonWalsh Are you still facing this issue?
@NWilliamsonWalsh , below is the way to do it.
Below is the code
let stackView = CardPartStackView()
stackView.margins = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
stackView.isLayoutMarginsRelativeArrangement = true
stackView.layoutMargins = UIEdgeInsets(top: 0, left: 63, bottom: 0, right: 62)
stackView.axis = .vertical
stackView.distribution = .fill
//Create a button
let button = CardPartButtonView()
button.translatesAutoresizingMaskIntoConstraints = false
button.setTitle("Test Button", for: UIControl.State.normal)
stackView.addArrangedSubView(button)
I'm trying to make a button with a border that isnt the same width as the card. I've tried:
`buttonView.widthAnchor.constraint(equalToConstant: 64.0).isActive = true
it doesn't seem to have any affect.