How to make a Mac OSX Cocoa application fullscreen?

后端 未结 4 1790
失恋的感觉
失恋的感觉 2021-02-01 19:11

I have been trying to make my Mac application enter fullscreen now for a while but can\'t get it to work. According to the Apple developer center, I should use enterFullScreenMo

4条回答
  •  没有蜡笔的小新
    2021-02-01 19:49

    As mentioned in the link Jonathan provided in the comments, enterFullScreen:withOptions: has a number of drawbacks that can make you want to tear your hair out. The best way to do fullscreen is still the older CGDirectDisplay API. Cocoa Dev Central has an article on fullscreen apps that covers pretty much everything you need to know.

    You'll notice the article is pretty ancient and the dev tools have changed a lot since then (Project Builder! Ah, the good old days), but the code itself will still work.

提交回复
热议问题