13

I am trying to do a contentInset on an NSScrollView the same way as iOS in a UIScrollView. There is no method to do this though. Is there anyway to achieve this? this picture should describe what I am trying to do:

enter image description here

If anyone knows of a solution I would absolutely love to hear!! It's driving me nuts

foobar5512
  • 2,470
  • 5
  • 36
  • 52

1 Answers1

24

You should try something like this  

scrollView.automaticallyAdjustsContentInsets = NO;
scrollView.contentInsets = NSEdgeInsetsMake(offset, 0, 0, 0);
AbcAeffchen
  • 14,400
  • 15
  • 47
  • 66
Marcel Derks
  • 569
  • 5
  • 8
  • 3
    These properties are only available in OS X 10.10. – iMaddin Sep 24 '14 at 16:54
  • 1
    Also, after doing that you might have to add `scrollView.contentView.scrollToPoint(NSMakePoint(0, -offset))` to scroll to the top as the initial scrolling position will be off once the `contentInset` is changed. – iMaddin Oct 17 '14 at 21:17