I am porting an app from Ipad to mac. (I know that it sounds weird)
I stuck with NSScrollview. Please guide me contentsize , contentOffset equivalent in NSScrollview.
I am porting an app from Ipad to mac. (I know that it sounds weird)
I stuck with NSScrollview. Please guide me contentsize , contentOffset equivalent in NSScrollview.
=
Edit: modernized the syntax
Everything you need to know about
NSScrollView
is laid out in the Scroll View Programming Guide for Cocoa provided in the documentation.Although it doesn't appear that there's a direct equivalent,
UIScrollView
'scontentSize
can be likened to the size ofNSScrollView
'sdocumentView
, which is the scrollable content provided as anNSView
toNSScrollView
withsetDocumentView:
.setContentOffset:
can be compared toNSView
'sscrollPoint:
, which uses anNSPoint
to specify the offset of thedocumentView
within theNSScrollView
.See the documentation for elaboration and code examples.
In addition to the lines from @aepryus, here are a couple more useful lines for getting/setting the scroll offset on macOS: