隐藏滚动条,同时在NSScrollView中启用滚动本身 [英] Hide scrollers while leaving scrolling itself enabled in NSScrollView

查看:349
本文介绍了隐藏滚动条,同时在NSScrollView中启用滚动本身的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想隐藏NSScrollViewNSScroller.我知道方法setHasHorizontalScroller:setHasVerticalScroller:.但是,如果禁用滚动条,则沿该方向滚动也将被禁用.我只想隐藏滚动条,同时保持滚动的可能性.有什么想法吗?

I'd like to hide the NSScrollers of NSScrollView. I'm aware of the methods setHasHorizontalScroller: and setHasVerticalScroller:. However, if I disable the scrollers, scrolling in that direction gets disabled as well. I'd like to only hide the scrollers while maintaining the possibility to scroll. Any thoughts on this?

推荐答案

我能够这样做:

[labelsScrollView setHasHorizontalScroller:YES];
[[labelsScrollView horizontalScroller] setAlphaValue:0];

这篇关于隐藏滚动条,同时在NSScrollView中启用滚动本身的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆