Mac OSX - NSScrollView禁止滚动
2017-05-10 本文已影响280人
Funcy1Day
自定义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的父视图需要对滚动的位置或尺寸大小进行调整