在我的自定义 NSTableCellView 中,我以-(void)drawRect
这种方式覆盖(我这样做是因为我有图案图像背景。NSWindow
我只需要NSLabel
在 cellView 中显示):
- (void)drawRect:(NSRect)dirtyRect
{
[[NSColor clearColor] setFill];
NSRectFill(dirtyRect);
[super drawRect:dirtyRect];
}
我得到了这个结果,它使整个NSWindow
透明:
我想要像VOX mac app这样的结果(看看红色的日食,你会看到 cellView 对父背景图像是透明的):