订购彩色面板
我们都知道这将使颜色面板向前移动:[[NSApplication sharedApplication] orderFrontColorPanel:nil];
,但是如何再次隐藏它呢?我尝试了 orderOutColorPanel:
,但它不起作用。
We all know this will bring the color panel forwards: [[NSApplication sharedApplication] orderFrontColorPanel:nil];
, but how to hide it again? I tried orderOutColorPanel:
, but it does not work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如有疑问,请使用暴力:
When in doubt, use brute force:
你是对的。 NSApplication 上没有方法可以关闭颜色面板。一旦面板显示,用户就可以控制该面板。
You are correct. There is no method on NSApplication to close the color panel. It is intended that the user will have control over the panel once it is shown.
截至2016年,有一个方法。
在 Swift 3 中,你可以像这样切换 NSColorPanel:
As of in 2016. There is a method.
in Swift 3, you can toggle NSColorPanel like this: