I want my ScrollView to only scroll vertically but it also scrolls horizontally. I have the leading and trailing constraints set to 0 but somehow it is still adding space to allow it to scroll.
When I click on the embedded view or scroll view, I see the red lines to the left and right but not sure how to prevent them from being added.
2
Answers
You must set scrollview’s
contentView
width is equal to superView(device Width). Than after your scrollView stop scrolling horizontal.Thanks.
Follow the routine of creating a vertical scroll view.
First, You need to change Simulated Size to FreeForm.
Second, Put in a ScrollView, set up Constrains.
Third, Put a View on top of it, set up Constrains.
Fourth, set the layout for SuperView.
Fifth, change Priority and Mutipier
And now we can work up here !