我将源列表 NSOutlineView 添加到作为 Split View Controller 一部分的 View Controller (如果重要的话),而不是常规 NSOutlineView。
如果应用程序位于前面和中间,那么它看起来确实不错。但是,当我使用 Tab 键切换到另一个应用程序时,我的源列表 OutlineView 会变黑,而常规 NSOutlineView 会变白并保持白色。
我应该对我拖放到界面生成器中的 NSOutlineView 做一些事情吗?
此外,当我移动应用程序时,outlineView 的透明背景不会更新。当您移动 Xcode 时,您可以看到背景发生变化。
最佳答案
编辑:
当 NSSplitView
是 NSTabView
的子级时,可以重现该错误。
SourceList 或任何具有 behindWindow
混合的 NSVisualEffectView
在背景中时将显示为黑色。
解决方案是不要这样做,因为它违反 Apple Guidelines :
A source list that provides selection functionality for the window, but not the app as a whole, uses an opaque background. Here, you can see the opaque background of the source list in Network preferences, in which users select a network service to configure.
关于cocoa - NSOutlineView 作为源列表在不活动时变黑。移动时也不更新其背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35662317/