2017-03-26 2 views
0

셀 기반 NSOutlineView의 소스보기 강조 표시가 10.12 미만입니다. 내가 처음 셀을 클릭하고 편집 모드로 전환 할 때, 모든 것이 괜찮 그러나NSOutlineView 10.12에서 편집하는 동안 셀 기반 배경 결함이 발생했습니다.

Valid Edit

, 최대한 빨리 편집을 시작으로, 배경은 하이라이트와 같은 파란색으로 변합니다.

enter image description here

나는 (성공없이) 시도 :

@interface NonBackgroundDrawingTextView : NSTextView 
@end 

@implementation NonBackgroundDrawingTextView 
-(BOOL)drawsBackground 
{ 
    return NO; 
} 
@end 


-(NSTextView *)fieldEditorForView:(NSView *)controlView 
{ 
    NSTextView* textView = [[NonBackgroundDrawingTextView alloc] initWithFrame:NSZeroRect]; 
    [textView setFieldEditor:YES]; 
    [textView setFocusRingType:NSFocusRingTypeDefault]; 
    return textView; 
} 

어떤 아이디어? 그것은 10.10 및 10.11에서 잘 작동합니다.

+1

불행하게도, 셀 기반 모든 것이되지 않습니다 오버라이드 (override)이

에 datacell 설정합니다. 그 이후로 모든 버그는 수정되지 않습니다. 뷰 기반'NSOutlineView'를 대신 사용하십시오. – Astoria

답변

0

서브 클래스 NSTextFiled 다음

- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength 
{ 
    NSRect textFrame = [self titleRectForBounds:aRect]; 

    [super selectWithFrame:textFrame inView:controlView editor:textObj delegate:anObject start:selStart length:selLength]; 
    [textObj setBackgroundColor:[NSColor whiteColor]]; 
    [textObj setDrawsBackground:YES]; 

} 
관련 문제