문제

둥근 흰색 손잡이와 화살표/슬롯 없음 (배경)이없는 스크롤 막대를 만드는 다음 NSSCroller 서브 클래스가 있습니다.

@implementation IGScrollerVertical

- (void)drawKnob
{
    NSRect knobRect = [self rectForPart:NSScrollerKnob];
    NSRect newRect = NSMakeRect(knobRect.origin.x, knobRect.origin.y, knobRect.size.width - 4, knobRect.size.height);
    NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:newRect xRadius:7 yRadius:7];
    [[NSColor whiteColor] set];
    [path fill];
}

- (void)drawArrow:(NSScrollerArrow)arrow highlightPart:(int)flag
{
    // We don't want arrows
}

- (void)drawKnobSlotInRect:(NSRect)rect highlight:(BOOL)highlight
{
    // Don't want a knob background
}
@end

스크롤러를 사용할 때 눈에 띄는 지연이있는 것을 제외하고는 모두 잘 작동합니다. 이 비디오보기 :

http://twitvid.com/70e7c

내가 뭘 잘못하고 있는지, 어떤 제안이든 혼란스러워?

도움이 되었습니까?

해결책

문제를 수정했습니다. DrawKnobslotinRect에서 RECT를 채워야했습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top