skip to Main Content

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.

enter image description here

enter image description here

2

Answers


  1. You must set scrollview’s contentView width is equal to superView(device Width). Than after your scrollView stop scrolling horizontal.

    Thanks.

    Login or Signup to reply.
  2. 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 !

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search