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的父视图需要对滚动的位置或尺寸大小进行调整

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 10,110评论 0 23
  • ViewsBecause view objects are the main way your applicati...
    梁光飞阅读 671评论 0 0
  • 有没有这样的经历:走进一个房间却突然忘记自己要干什么。那是上帝在玩《模拟人生》,突然取消了你的动作。几年前的段子。...
    Hakee阅读 784评论 1 4
  • 大端模式(Big-endian),是指数据的高字节,保存在内存的低地址中,而数据的低字节,保存在内存的高地址中(T...
    abb266389fd0阅读 984评论 0 1
  • 当我决定回归这座小城,改变就已经开始了,我渴望改变自己,而不只是囿于原有的地步.我知道过了一段时间,这种激情过后,...
    Sophie12138阅读 427评论 1 1