如何在NSPopOver中更改NSTextField背景颜色

Coc*_*ser 8 macos cocoa objective-c

在此输入图像描述

Mac OSX 10.10 Xcode 6.1

我在NSPopOver中创建了一个tableview.我尝试更改textfield的背景颜色.为什么?没有效果.tableview的亮点设置为"常规".哪种方式可以让我将textfields背景颜色改为白色?

Ken*_*ses 20

在Yosemite中添加了文本字段和"vibrancy"混合的已知错误.众所周知会影响到弹出窗口.

解决方法是appearance将表视图的属性设置为NSAppearanceNameAqua.

这是证实在他们的devforums苹果工程师.


Pro*_*tto 10

在我的应用程序中,我有同样的问题.我使用Swift,这对我有用.在viewForTableColumn中:

let cell = tableView.makeViewWithIdentifier(tableColumn!.identifier!, owner: self) as! NSTableCellView
    cell.textField?.drawsBackground = true
    cell.textField?.backgroundColor = NSColor.clearColor()
Run Code Online (Sandbox Code Playgroud)