How to embed UIStackView inside UIScrollView in iOS

Issue #324

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

Written by

I’m open source contributor, writer, speaker and product maker.

Start the conversation