contentsize and contentOffset equivalent in NSScroll view

前端 未结 3 905
北海茫月
北海茫月 2020-12-13 09:52

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 NSScrollvi

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 10:18

    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's contentSize can be likened to the size of NSScrollView's documentView, which is the scrollable content provided as an NSView to NSScrollView with setDocumentView:.

    setContentOffset: can be compared to NSView's scrollPoint:, which uses an NSPoint to specify the offset of the documentView within the NSScrollView.

    See the documentation for elaboration and code examples.

提交回复
热议问题