1

I have a ScrollView that starts at a Y position of 50, inside the ScrollView I have a StackView with dynamic elements added. The elements are added and the scroll works as expected. However the StackView is drawn at Y=0 so that the first element is against 0,0 of the application while the ScrollView is at 0,50.

I have tried several things from assigning constraints, to changing the frame.origin.y position and frame.offsetInPlace.

Are there any recommendations out there? It all is being done dynamically with SWIFT and without a xib.

Helmut Granda
  • 4,565
  • 7
  • 35
  • 51

1 Answers1

1

You can find an example of scrollView with stackView here:

UIStackView - Distribute views evenly from the centre

Thanks Hamza Ghazouani for the tip.

Community
  • 1
  • 1
Helmut Granda
  • 4,565
  • 7
  • 35
  • 51