Scrolling Position NSScrollView

I currently have an NSView in an NSScrollView. NSView is big and I need to scroll to control the object inside.

I want to draw a static rectangle in the center of NSView without scrolling. I want to get a scroll point (NSClipPoint?) In the drawRect NSView method to draw a rectangle in the last drawRect step to make it on top.

I looked through the document and could only find methods to set the scroll point, rather than getting it. How can I get this point?

+3
source share
2 answers

Answer [[myScrollView contentView] documentVisibleRect]

+8
source

, , ( 8 Mac, ). NSClipView, NSScrollView, NSClipView drawRect:? , , NSScrollView ?

, , Google.:)

+1

Source: https://habr.com/ru/post/1778037/


All Articles