2017-03-26 7 views
0

ソースビューハイライトを使用して10.12未満のセルベースのNSOutlineViewがあります。私は最初のセルをクリックして、それが編集モードに入ると、すべてがOKです: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

を上書き残念ながら、セルベースのすべてが廃止されました。それ以降、これらのバグは修正されません。代わりに、ビューベースの 'NSOutlineView'を使用してください。 – Astoria

答えて

0

サブクラス NSTextFiled、この

にdatacell設定し、その後

- (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]; 

} 
関連する問題