在我的自定义NSTableCellView我重写-(void)drawRect
这样(我这样做是因为我有模式图像背景NSWindow
我需要只显示cellView NSLabel
):
NSTableCellView透明背景
- (void)drawRect:(NSRect)dirtyRect
{
[[NSColor clearColor] setFill];
NSRectFill(dirtyRect);
[super drawRect:dirtyRect];
}
和我得到这样的结果,它使整个NSWindow
透明:
我想导致像VOX mac app做(看红色月食,你看cellView是与父母的背景图像透明):
_tableView.usesAlternatingRowBackgroundColors = NO; – johndpope