Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cocoa NSPopover+;NSBox在暗模式下着色/伽马问题_Cocoa_Nspopover_Nsvisualeffectview_Nsbox_Macos Darkmode - Fatal编程技术网

Cocoa NSPopover+;NSBox在暗模式下着色/伽马问题

Cocoa NSPopover+;NSBox在暗模式下着色/伽马问题,cocoa,nspopover,nsvisualeffectview,nsbox,macos-darkmode,Cocoa,Nspopover,Nsvisualeffectview,Nsbox,Macos Darkmode,我有nspover和NSBox,子视图是:MKMapView和NSImageView。在暗模式下,整个NSBox将向所有子视图添加gamma/tint。这不会在灯光模式下显示(比较下面的图像)。它似乎与NSVisualEffectView有关。如何防止/禁用此效果 PS:这种效果在普通窗口中不显示。只有popover受影响 编写开箱即用的拖放元素代码。莫哈韦10.14.4 - (IBAction)showPopover:(id)sender { [[self popover] sho

我有
nspover
NSBox
,子视图是:
MKMapView
NSImageView
。在暗模式下,整个NSBox将向所有子视图添加gamma/tint。这不会在灯光模式下显示(比较下面的图像)。它似乎与
NSVisualEffectView
有关。如何防止/禁用此效果

PS:这种效果在普通窗口中不显示。只有popover受影响

编写开箱即用的拖放元素代码。莫哈韦10.14.4

- (IBAction)showPopover:(id)sender {
    [[self popover] showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSRectEdgeMaxX];
}
编辑:2020年4月 根据“采用OSXYosemite新用户界面的高级功能”()的说法,这是由于填充颜色的一些活力效应造成的。Popover的有效外观为
nsvibrantarkapearance

(lldb) po [self.view .effectiveAppearance]
▿ 1 element
  - 0 : <NSCompositeAppearance: 0x60000210a940
 (
    "<NSVibrantDarkAppearance: 0x60000170b840>",
    "<NSDarkAquaAppearance: 0x60000170ae80>",
    "<NSSystemAppearance: 0x60000170afc0>"
)>
lldb) po [self.view .superview]
▿ 1 element
  ▿ 0 : Optional<NSView>
    - some : <NSPopoverFrame: 0x1020a63f0; material: Popover; blendingMode: BehindWindow; state: Active>
(lldb)po[self.view.effectiveAppearance]
▿ 1要素
- 0 : 
lldb)po[self.view.superview]
▿ 1要素
▿ 0:可选
-一些:

所以,其他可能的解决方案是使用不鲜艳的填充颜色。

通过在
NSBox
后面添加额外的
NSVisualEffectView
来解决,其中混合设置为在窗口内发生。左(带视觉效果视图),右(不带)


通过在
NSBox
后面添加额外的
NSVisualEffectView
来解决,其中混合设置为在窗口内发生。左(带视觉效果视图),右(不带)