草庐IT

NSBackgroundStyle

全部标签

macos - 为什么 NSTableCellView.backgroundStyle 永远不会为选定的行设置为 NSBackgroundStyle.Dark?

在基于View的NSTableView中,我有一个NSTableCellView的子类。我想更改选定行的cellView的文本颜色。classCellView:NSTableCellView{overridevarbackgroundStyle:NSBackgroundStyle{set{super.backgroundStyle=newValueself.udpateSelectionHighlight()}get{returnsuper.backgroundStyle;}}funcudpateSelectionHighlight(){if(self.backgroundStyle=