Setting a lighter (white) scrollbar color in Lion
My (cocoa) application has an usability problem with Lion (OS X 10.7). There is a scrollable component that has a dark background, so it is hard to see the default transparent dark scrollbar.
Is there a way to replace the appearance of the开发者_运维百科 scrollbars with a lighter (white) one? Safari and other browsers seem to do this dynamically based on the websites backgrounds, but I have found no easy solution for a native cocoa application. Is there a solution that do not involve subclassing NSScrollView?
[myScrollView setScrollerKnobStyle:NSScrollerKnobStyleLight];
From the NSScrollView Class Reference.
If your window is created in IB, you can change the scroller style in the Attributes inspector.
精彩评论