I have a scroller, inside it I have a UIView element called ContentView. Inside ContentView i have a StackView that's filled with dynamically created buttons. I am adding buttons programmatically to the StackView, also I assign each button to the StackView:
self.stackViewButtons.autoresizingMask = UIViewAutoresizing.flexibleWidth
self.contentView.autoresizingMask = UIViewAutoresizing.flexibleWidth
Ok, if someone passes by, this helped me a lot - scroll down to dynamic stack views. I am using Auto Layout and I am dynamically adding buttons to the stackView, my mistake was that I was using
Using addSubview caused the content on scroller to always remain the same like pre-runtime.