Issue #172

https://stackoverflow.com/questions/51644692/nsstackview-subviews-not-resizing-sub-stack-views/55220837#55220837

If you want child view inside vertical NSStackView to fill its parent width, then reduce contentCompressionResistancePriority

myChildView.translatesAutoresizingMaskIntoConstraints = false
myChildView.setContentCompressionResistancePriority(
  NSLayoutConstraint.Priority(rawValue: 1),
  for: .horizontal
)

NSLayoutConstraint.activate([
  myChildView.heightAnchor.constraint(equalToConstant: 50)
])

NSAnimationContext.runAnimationGroup({context in
  context.duration = 0.25
  context.allowsImplicitAnimation = true
  stackView.insertArrangedSubview(myChildView, at: 1)

  view.layoutSubtreeIfNeeded()
}, completionHandler: nil)

Updated at 2020-11-20 16:11:11