macosinterface-buildernsstackview

How to make buttons fill vertically in a NSStackView with a fixed height


enter image description here

The NSStackView shown above has top/leading/trailing constraints, a proportional height to its superview, and is set to Align Top and Fill Equally. I want to have the buttons stretch vertically to fill the height of their stack view. How can I configure this with a NSStackView? Or do I have to add constraints on the buttons?


Solution

  • I solved my problem by setting top/bottom constraints on the buttons to the stack view. I don't think there is a way to configure an NSStackView to do what I want.

    So a UIButton fills the height of the UIStackView if the UIStackView's alignment is set to fill. An NSStackView does not have a fill property for alignment and AFAIK, can't make an NSButton do the same thing