1. NSVIew设置背景色
注意wantsLayer需要先写才生效
self.bgView.wantsLayer = YES;
self.bgView.layer.backgroundColor = [NSColor redColor].CGColor;
2. NSTextFieldCell设置背景色
setDrawsBackground:YES
self.openResultLabel.backgroundColor = [NSColor whiteColor];
[self.openResultLabel setDrawsBackground:YES];
网友评论