如何在 Lion 中自动隐藏 NSScroller?
我有一个 NSScroller,用于滚动我的一些完整的自定义视图。使用 [scroller setScrollerStyle:[NSScroller PreferredScrollerStyle]]
我得到了滚动条的正确样式。现在,当滚动条具有 NSScrollerStyleOverlay 时,我假设它在不使用时会自动隐藏。就像使用标准 NSScrollView 时一样。但事实并非如此。它总是可见的。
有没有建议的方法来自动隐藏滚动条?或者我必须使用计时器等来完成该手册吗?
I have an NSScroller that is used to scroll some complete custom view of mine. With [scroller setScrollerStyle:[NSScroller preferredScrollerStyle]]
I get the correct style of the scroller. Now when the scroller has NSScrollerStyleOverlay
, I assumed it will automatically hide when it is not used. Like it does when using a standard NSScrollView. But it doesn't. It's always visible.
Is there a suggested way to hide the scrollers automatically? Or do I have to do that manual with timers etc?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我最终重新设计了我的视图,以便它们适合 UIScrollView。所以我解决了这个问题。
I ended up redesigning my view's so they fit in a UIScrollView. So I worked around this problem.
选择您的滚动条并转到“属性检查器”并选中“自动隐藏滚动条”复选框。应该可以做到这一点。
Choose Your scroller and go to "Attributes inspector" and check checkbox "Automatically Hide Scroller". That should do it.
请参阅 Mac OS X 10.7 中的新增功能 - 覆盖滚动条
兼容性注意,您可能会遇到第三种情况:“任何不由 NSScrollView 管理的 NSScroller”。或者您可能有一个不完全支持覆盖滚动条的“外部指点设备”?
See What's New in Mac OS X 10.7 — Overlay Scrollbars
Under Compatibility Notes, you may be probably hitting the 3rd case: "Any NSScroller that is not managed by an NSScrollView". Or possibly you have an "external pointing device" that doesn't fully support overlay scrollers?