How to embed UIStackView inside UIScrollView in iOS

Issue #324

1
2
3
4
5
6
7
8
9
10
11
view.addSubview(scrollView)
scrollView.addSubview(stackView)

NSLayoutConstraint.on([
scrollView.pinEdges(view: view),
stackView.pinEdges(view: scrollView)
])

NSLayoutConstraint.on([
stackView.widthAnchor.constraint(equalTo: scrollView.widthAnchor, multiplier: 1.0)
])

Updated at 2020-09-07 14:28:15

Comments