Content Inset with WebView

Discussion in 'Mac Programming' started by Blakeasd, Nov 28, 2013.

  1. Blakeasd macrumors 6502a

    Dec 29, 2009
    Is there any way to use a content inset such as the one available with iOS's WebView. In iOS you can do:

    and set that property.

    I know how to get the NSScrollView itself like this in my WebView subclass:

     - (NSScrollView *)mainScrollView {
    return [[[[self mainFrame] frameView] documentView] enclosingScrollView]; // can be nil
    and then get an instance of that NSScrollView:

    NSScrollView *mainScrollView = [self.webView mainScrollView];
    Now as stated before I need to set the WebView to be inset in the ScrollView so I can have the content show up under my translucent navigation bar. Currently, the translucent navigation bar covers up the top of the WebView on start, so I need the WebView to sit lower in the NSScrollView.
    I need to do this with Mac's WebView as I have a translucent type navigation bar that the WebView goes under.

    Any ideas and help is greatly appreciated!
  2. Blakeasd thread starter macrumors 6502a

    Dec 29, 2009
    Any takers? I wish Apple would make some of the APIs more up-to-date with iOS :mad:
  3. Blakeasd thread starter macrumors 6502a

    Dec 29, 2009
    After several hours I've found RMSecondaryScroller. This did the trick! Hopefully someone in the future will find this useful!

Share This Page