简体   繁体   English

如何在Mac OS X Lion中创建薄滚动条

[英]How to create a thin scroll bar in Mac OS X Lion

How would I go about create a thin scroll bar like in the Stickies app on OSX Lion? 我将如何像在OSX Lion上的Stickies应用中那样创建一个薄滚动条?

在此处输入图片说明

如果设置NSScroller以“小”控件的大小,无论是在IB或使用-setControlSize:是不正确的薄度?

The release notes for Lion's version of AppKit outline when overlay scrollbars are and are not used: 在使用和不使用覆盖滚动条时,Lion的AppKit版本发行说明概述了:

Unless the user overrides scrollbar appearance using System Preferences, the following behavior occurs: 除非用户使用系统偏好设置覆盖滚动条外观,否则会发生以下现象:

  • If all of the user's pointing devices support both horizontal and vertical touch scrolling, the scrollbars are hidden during normal use. 如果所有用户的指向设备都支持水平和垂直触摸滚动,则在正常使用期间滚动条将隐藏。 They appear as an overlay on top of the window's content while the user is scrolling, and remain visible briefly to allow scrollbar dragging. 它们在用户滚动时显示为窗口内容顶部的覆盖图,并短暂可见以允许滚动条。

  • If the user has at least one external pointing device that does not support scrolling, the scrollbar is displayed at all times and the usable space in the window is reduced, as in previous versions of Mac OS X. (These permanent scrollbars are referred to as legacy scrollbars.) 如果用户至少有一个不支持滚动的外部定点设备,则滚动条将始终显示,并且窗口的可用空间会减少,就像Mac OS X的早期版本一样。(这些永久滚动条称为旧版滚动条。)

  • If the user has no external pointing devices attached, the trackpad settings control the scrollbar behavior; 如果用户没有连接外部指针设备,则触控板设置将控制滚动条的行为; if the user has disabled scrolling for the trackpad in System Preferences, legacy scrollbars are used. 如果用户在“系统偏好设置”中禁用了触控板的滚动,则将使用旧版滚动条。

Compatibility Note: There are three situations in which legacy scrollbars are used regardless of hardware or preferences: 兼容性说明:在三种情况下,无论硬件或首选项如何,都使用旧版滚动条:

You should check if all the conditions are met on your machine and in your app. 您应该检查计算机和应用程序中是否满足所有条件。

You could also set the scroller style explicitly using NSScroller setScrollerStyle: , but it's probably better to respect the defaults and user preferences. 您还可以使用NSScroller setScrollerStyle:显式设置滚动器样式,但是最好遵循默认值和用户首选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM