NSStatusItem's menu are not shown in Full Screen Model for the Mac os 10.13.1

我与影子孤独终老i 提交于 2019-12-07 12:02:52

问题


all:

I have added one NSStatusItem in the status bar for my test app, and it works well in Mac ox 10.12, not only normal model, but also full screen model. When i switch to Mac os 10.13, it is failed to show the menu in the full screen model.

self.statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
        self.statusItem.highlightMode = YES;
        self.statusItem.menu = self.dummyMenu;
        [self.statusItem.menu setDelegate:self];
        self.statusItem.image = image;

does anyone has any idea? The pop up menu, in full screen model, it will not show


回答1:


I also have encountered the same issue and found the solution that

[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];

shows the menu, though hides its main menu and dock. I hope this helps.



来源:https://stackoverflow.com/questions/47674502/nsstatusitems-menu-are-not-shown-in-full-screen-model-for-the-mac-os-10-13-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!