0

I already tried hours to make it work. I have a UIScrollView with a View in it, the content view. I placed 2 buttons inside of it, 1 button to the left and 1 button way out of my view so I can "scroll" to it. I tried making the scrollview contentsize to small by:

scrollview.contentsize = CGSize(width: 300, height: 300) that did not work, and making it extremely large does not work aswell. It did however worked without the View in it, but I saw in tutorials they recommend to add a different view into it.

The content view is pinned with constrains of 0's to the uiscrollview. However, I needed to add more constrains so I added center X and center Y to the UIScrollView aswell. I am wondering what I am doing wrong and I hope you can help me. I can add more code or pictures if needed. Regardless of this question is asked alot, I can not figure out how to do this very simple task. It did work without the content view. It should be a dynamic UIScrollView,

NoKey
  • 129
  • 11
  • 32
  • Please see these questions : [link](http://stackoverflow.com/questions/19036228/uiscrollview-scrollable-content-size-ambiguity?rq=1) and this one [link](http://stackoverflow.com/questions/21273585/uiscrollview-not-scrolling-regardless-of-large-contentsize?rq=1) – user2773289 Mar 02 '17 at 18:32
  • Yes all my margins are set to 0, from my content view to the uiscrollview. – NoKey Mar 02 '17 at 18:36
  • By default your scrollView won't scroll if the content is smaller than the frame of the scrollView. You say you made the content large (though seeing the code would help), so I'd check the scrollView's `isScrollingEnabled` property, or checking which directions you are allowing the scrollView to scroll. Show your code and we will have better suggestions. – creeperspeak Mar 02 '17 at 18:45
  • Scrolling is enabled and I make the size bigger by using myScrollView.contentsize.height = 10000 and the same for w the width. This worked without the content view inside it. I think that is the problem. – NoKey Mar 02 '17 at 19:13

0 Answers0