How to change NSTextField background color in NSPopOver

前端 未结 3 1855
南旧
南旧 2020-12-06 17:35

\"enter

Mac OSX 10.10 Xcode 6.1

I created a tableview in NSPopOver. I try to

3条回答
  •  悲&欢浪女
    2020-12-06 18:25

    There's a known bug with text fields and the "vibrancy" blending added in Yosemite. It's known to affect popovers.

    The workaround is to set the appearance property of the table view to NSAppearanceNameAqua.

    This was confirmed by an Apple engineer in their devforums.

    2019-05-09 EDIT:

    This issue also sometimes affects NSTextFields that appear on popovers where the background is grey. Here's the Swift 5 fix, add this to the viewDidLoad() function of your popover controller

    self.someTextField.appearance = NSAppearance.init(named: .aqua)

提交回复
热议问题