Stackviews In A View

I have StackViews enclosed in a view and whenever I scroll upwards the view collapses, its height shrinks basically. I want the view to not move when I scroll upwards. How do I do that?


whenever I scroll upwards the view collapses

Which view do you scroll ? The container view ?


I want the view to not move when I scroll upwards

Which view should not move ?

Please be very explicit in the use case.
Yeah it's like a container view but without a childvc. I don't want the container to move when I scroll. I have a video of the issue but this site is not letting me post it.

 I don't want the container to move when I scroll.

When you scroll what ? Inside the stackView ?

Would be helpful to post the video elsewhere.
The container view should not move it should be still like the text.
Yes I scroll the container view and I don't want that container to move. Is there any way I can upload images, I think that can make you understand better?
So you want the stackView to stay in place when you scroll the container ? Which means that the stack view will not keep a fixed position relative to container ?

If I understand correctly, you should:
  • in IB, take the stackView outside the scrollable container (put it at top hierarchical level)

  • set constraints for stackView relative to the safe area.

Okay so I should not have my stackviews be apart of a container.
Did you solve it ? If so, don't forget to close by marking correct answer.

Have a good day.
I took my 2 stackviews out of the container but when I have vertical spacing with them to the text it collapses.

I took my 2 stackviews out of the container but when I have vertical spacing with them to the text it collapses.

This is not enough.
If you don't explain more clearly, with full details, your set up, what you get and what you expect, it will be very hard to help.
Stackviews In A View
 
 
Q