How to display NSPanel in front of Fullscreen-View

2019-05-12 20:46发布

My application rund modally in fullscreen, and I need something like iOS' UIPopoverController. The first idea was using an NSPanel, but I can't get it to show in front of the fullscreen view.

I need either a UIPopoverController-like class for Cocoa or a way to display a NSPanel in front of a fullscreen view. How can I accomplish this?

3条回答
Evening l夕情丶
2楼-- · 2019-05-12 21:16

Something like

[yourPanel setLevel:[fullscreenWindow level] + 1];

should work.

查看更多
别忘想泡老子
3楼-- · 2019-05-12 21:34

Sorry, none of them really worked.

The solution was:

[yourPanel setLevel:kCGMaximumWindowLevel];

However, Wevah and SphereCat1 helped me find the setLevel: method. Thanks.

查看更多
叼着烟拽天下
4楼-- · 2019-05-12 21:40

Try this instead:

[yourPanel setLevel:NSMainMenuWindowLevel+1];

That should put it above everything on the screen. Happy Coding!
Billy

查看更多
登录 后发表回答