Mac OSX - NSScrollView禁止滚动

自定义NSScrollView子类中实现

override func reflectScrolledClipView(_ cView: NSClipView) {

}

方法,不调用super....的方法。此函数在apple官方文档中的解释为:

funcreflectScrolledClipView(_clipView:NSClipView)

DescriptionNotifies a clip view’s superview that either the clip view’s bounds rectangle or the document view’s frame rectangle has changed, and that any indicators of the scroll position need to be adjusted.

NSScrollViewimplements this method to update itsNSScrollerobjects.

ParametersaClipView

TheNSClipViewobject whose superview is to be notified.

即此方法通知clipView的父视图需要对滚动的位置或尺寸大小进行调整

你可能感兴趣的:(Mac OSX - NSScrollView禁止滚动)