Let's say I have added more views in UIStackView which can be displayed, how I can make the UIStackView
scroll?
In case anyone is looking for a solution without code, I created an example to do this completely in the storyboard, using Auto Layout.
You can get it from github.
Basically, to recreate the example (for vertical scrolling):
UIScrollView
, and set its constraints.UIStackView
to the UIScrollView
Leading
, Trailing
, Top
& Bottom
should be equal to the ones from UIScrollView
Width
constraint between the UIStackView
and UIScrollView
. UIStackView
UIViews
to the UIStackView
Exchange Width
for Height
in step 4, and set Axis
= Horizontal
in step 5, to get a horizontal UIStackView.