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?
            Asked
            
        
        
            Active
            
        
            Viewed 1,801 times
        
    3
            
            
        - 
                    Set align = .fill – Fogmeister Dec 22 '16 at 20:45
 
2 Answers
2
            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
        elce
        
- 264
 - 4
 - 16
 
1
            
            
        As you already noticed, it's not possible using NSStackView. It lacks fill alignment, available for UIStackView. 
However, there is a much more powerful UI component in AppKit:
NSGridView - https://developer.apple.com/documentation/appkit/nsgridview
You can customize alignment for each row and column, including "fill" mode.
        Darrarski
        
- 3,882
 - 6
 - 37
 - 59
 
