Change selection color on view-based NSTableView

前端 未结 13 2106
别跟我提以往
别跟我提以往 2020-12-07 19:11

Standard highlighting color in OS X applications is blue.

Is it possible to change it to another color, e.g. gray?

Note that I am using the new view-based

13条回答
  •  感动是毒
    2020-12-07 19:15

    As already mentioned, set emphasized attribute to false, but do it in the custom NSTableRowView class to avoid side effects (like dancing color effect):

        override func drawRect(dirtyRect: NSRect) {
           super.drawRect(dirtyRect)
           self.emphasized = false
    
        }
    

提交回复
热议问题