NSScrollView showing part of view with white space above

Graham Cox

One thing I find when working with scroll views is that making the contained view flipped is usually helpful. If you return YES from an override to -isFlipped, scroll views default to a position with the the scroller at the top, not the bottom. It generally makes layout and calculations in the view easier as you are working with a more conventional coordinate system. Flipping the view generally doesn’t make anything else more difficult -in fact, usually easier.

Also, just set the bounds to whatever size you need and NSScrollView will generally just figure out everything else. You don’t need to directly manipulate the scrollbars or calculate anything.


On 14 Oct 2019, at 12:30 am, Aandi Inston via Cocoa-dev <cocoa-dev@...> wrote:

But, the vertical scroll bar position is at the BOTTOM of the window.