NSScrollView中的自定义NSSroller

我在NSScrollView中嵌入了一个IKImageBrowserView。 我正在尝试实现我们在Lion或Sparrow和Reeder等其他应用程序中看到的滚动条。我希望我的滚动条能够覆盖内容。 所以我唯一的问题就是内容越过滚动条而不是下面。 我知道我可以使用NSScrollView的
-tile
方法来安排不同的部分,但我不知道如何将它用于我的目的。 编辑:这是我的code0ѭ中的代码:
- (void)tile
{
    [super tile];

    // We move the scroll to be just below the scrollView
    NSScroller *verticalScroller = [self verticalScroller];
    NSRect verticalScrollerFrame = [verticalScroller frame];
    verticalScrollerFrame.origin.x -= 117.0;
    [verticalScroller setFrame:verticalScrollerFrame];

    // We expand the scrollview to embrace the whole window
    NSRect scrollViewFrame = [self frame];
    scrollViewFrame.size.width = 655.0;
    [self setFrame:scrollViewFrame];

}
这是它的样子: 有谁知道为什么滚动条在内容视图下的内容?还是有一个例子? 我已经看过这个主题:在内容上覆盖NSScroller,而在没有找到答案的情况下覆盖很多其他内容。 谢谢你的帮助!     
已邀请:
好吧我想我发现了问题。
NSRect scrollViewFrame = [self frame];
scrollViewFrame.size.width = 655.0;
[self setFrame:scrollViewFrame];
在这个块中,我使用
[self frame]
来获取NSClipView contentFrame而不是
[[self contentView] frame]
。 它看起来应该是这样的。
NSRect scrollViewFrame = [[self contentView] frame];
scrollViewFrame.size.width = 655.0;
[[self contentView] setFrame:scrollViewFrame];
我还没试过,但我很确定这是问题所在。     
麻雀开发者在这里发布了他的代码: http://dinhviethoa.tumblr.com/post/6138273608/ios-style-scrollbars-for-nsscrollview     

要回复问题请先登录注册