0

I have the following scrollview. Inside the scroll view is a ui view and inside that are sub views and buttons. dynamically increase the content size of the scroll view to make it fit the content.

 self.scrollView.contentSize =  CGSize(width: self.scrollView.contentSize.width, height: self.scrollView.contentSize.height + CGFloat(300))

The content view inside the scroll view is not scrolling to the end of the content, so that content gets cut off. What should I do so that I can see all of the content inside the content view?

See attached

enter image description here

Rue Vitale
  • 1,549
  • 4
  • 17
  • 24
  • Are you constraining the top-most view's top anchor to the top anchor of the scroll view and the bottom-most view's bottom anchor to the bottom anchor of the scroll view (among other necessary constraints)? – trndjc Mar 10 '22 at 17:42
  • How do I do that? @liquidLFGUKRAINE – Rue Vitale Mar 10 '22 at 17:59
  • I'll be honest, I used Interface Builder for one day and that was it. I think it's one of the biggest piles of junk ever introduced to software developers in the history of programming. So I can't help you with IB, only programmatic, but the concepts are the same. This is your solution. – trndjc Mar 10 '22 at 18:02
  • Can you show me how to do this programmatically? @liquidLFGUKRAINE – Rue Vitale Mar 10 '22 at 18:05
  • Sure, this should explain it: https://stackoverflow.com/a/48219419/9086770 – trndjc Mar 10 '22 at 18:06

0 Answers0