2

下面是我的代码,它覆盖了水平滚动条上的控件。

- (void)tile
{
    [super tile];
    if (subControl)
    {
        NSRect subControlFrame = [subControl frame];

        NSScroller *horizontalScroller = [self horizontalScroller];

        NSRect scrollerFrame = [horizontalScroller frame];

        // adjust control position here in the scrollview coordinate space
        subControlFrame.origin.x = scrollerFrame.origin.x;
        subControlFrame.origin.y = scrollerFrame.origin.y;
        subControlFrame.size.height = scrollerFrame.size.height;
        // move controls
        [subControl setFrame:subControlFrame];

        NSRect subControlFrame2 = [subControl frame];

        scrollerFrame.origin.x += subControlFrame2.size.width;

        scrollerFrame.size.width -= subControlFrame2.size.width;

        [horizontalScroller setFrame:scrollerFrame];
    }
}

线后

    [subControl setFrame:subControlFrame];

它停止响应系统偏好?

4

0 回答 0