gpt4 book ai didi

objective-c - 当应用程序退出事件状态时,NSWindow 会无意中隐藏

转载 作者:行者123 更新时间:2023-12-03 17:33:46 25 4
gpt4 key购买 nike

每当我的 NSApplication 退出事件状态(例如,切换到另一个应用程序)时,应用程序的主 NSWindow 就会隐藏(如果我进入任务控制,应用程序的窗口不会不会出现在那里)。

NSApplication 方法-applicationWillResignActive-applicationDidResignActive 尚未实现

我还尝试在 NSWindow 上将 -canHide 设置为 NO

有人知道如何解决这个问题,或者更好的是,可能是什么导致了这个问题?

最佳答案

您是否在 IB 中设置了窗口的 hidesOnDeactive 属性?

Indicates whether the window is removed from the screen when its application becomes inactive.

这是面板的默认值:

The default for NSWindow is NO; the default for NSPanel is YES.

关于objective-c - 当应用程序退出事件状态时,NSWindow 会无意中隐藏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30305901/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com