Draw Text with a border and background for a NSTableView cell
问题 I have a cell-based tableview and I want to display some sort of tags within this tableview, preferably without having to use a view-based tableview. Is there an elegant way to achieve something like the example here (HTML), ideally with a background-color as well. 回答1: If you want to stick with a cell-based table view, you can subclass NSCell and override: - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { NSRect insetRect = NSInsetRect(cellFrame, 2.0, 2.0); NSBezierPath*