Lion 全屏菜单栏无法向下滑动
我有一个没有边框、标题栏、按钮等的小窗口。我想支持全屏模式(新的 Lion 类型),而且我基本上已经完成了所有工作 - 我可以切换到或退出全屏模式并且窗口会自行调整大小等,没有问题。
但是,当我将鼠标移至屏幕顶部时,带有关闭全屏模式图标的菜单栏不会向下滑动。
我怎样才能让它发挥作用?它是否与风格面具有关?还有别的事吗?
I've got a small window that has no borders, titlebar, buttons, etc. I want to support full -screen mode (the new Lion kind) and I basically have all that working -- I can switch into and out of fullscreen mode and the window resizes itself, etc, no problems.
However, when I move the mouse to the top of the screen, the Menu bar with the icon to close the full screen mode does not slide down.
How do I get that working? Is it keyed off a style mask? Something else?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
啊哈,关键在于您返回的内容
您需要添加
NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationAutoHideMenuBar |除了
添加到返回值。NSApplicationPresentationFullScreen
之外,还将 NSApplicationPresentationHideDockA-ha, the key is in what you return for
You need to add
NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationHideDock
to the returned values in addition toNSApplicationPresentationFullScreen
.要使全屏模式在 Lion 中工作,您唯一需要做的就是在窗口上调用
-setCollectionBehavior:
并传入NSWindowCollectionBehaviorFullScreenPrimary
。您不需要做任何其他事情。除非您的目标是 10.6 或更早版本,否则所有 kiosk 模式的内容都是不必要的。
The only thing you need to do to make full screen mode work in Lion is to call
‑setCollectionBehavior:
on your window and pass inNSWindowCollectionBehaviorFullScreenPrimary
.You don't need to do anything else. All the kiosk-mode stuff is not necessary unless you are targeting 10.6 or earlier.