【发布时间】:2020-05-21 08:11:05
【问题描述】:
这是一个macOS问题
在
func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView?
我正在使用
func tableViewSelectionDidChange(_ notification: Notification) {
cell.layer?.backgroundColor = mintGreen.cgColor
改变单元格颜色。
选择单元格时是否可以改变颜色?
谢谢
【问题讨论】:
-
在选定行或焦点文本字段中选定?
-
感谢您的回复。我已经更新了问题
-
参见stackoverflow.com/a/29474301/43615 - 这似乎对我有用,因为每次选择更改时我都会在 NSTableViewRow 子类中调用 drawRect。
标签: macos nstableview