I have a UIStackView
inside a UIScrollView
, and when the width of all items in stack view is less then the width of the scroll view, I want to make the stack view (or the items) to be horizontally centered aligned with the scroll view.
I have the following constraints:
For scrollView: H:|[stackView]|
and V:|[stackView]|
(so stack view fits with scroll view)
But I can see the stack view seems to shrink to a minimum size that just enough for all its arranged subviews' intrinsic content size, and it's left aligned to the scroll view.
Is there anyway to make it horizontally-centred in the scroll view?
Thanks!