Reputation: 4665
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.
Upvotes: 1
Views: 741
Reputation: 4665
You can find an example of scrollView with stackView here:
UIStackView - Distribute views evenly from the centre
Thanks Hamza Ghazouani for the tip.
Upvotes: 1