我有一个基于单元格的 NSTableView,在特定列中有一个文本单元格。我想提供一个自定义字段编辑器,这样我就可以在用户不按 F5 的情况下自动完成。
@implementation AutoCompleteFieldEditorTextView
-(id)init
{
self = [super init];
if (self)
{
self.focusRingType = NSFocusRingTypeDefault;
self.fieldEditor = YES;
}
return self;
}
@end
除了对焦环不存在外,这可以正常工作。即使我添加:
-(void)drawFocusRingMask
{
NSRectFill([self bounds]);
}
-(NSRect)focusRingMaskBounds
{
return [self bounds];
}
它仍然不起作用。如何获得在 NSTableView 中用作字段编辑器的默认 NSTextView 出现的确切焦点环?