How to Get Mac Desktop size

∥☆過路亽.° 提交于 2019-12-07 17:07:38

问题


How do I discover the size of the Desktop (or screen size) of the Mac?


回答1:


For the screen size use -[NSScreen frame] on an instance received through e.g. +[NSScreen mainScreen] or -[NSWindow screen].
To get the visible part without the dock and menu bar, use -[NSScreen visibleFrame].

Keep in mind that the full desktop can stretch over multiple screens.



来源:https://stackoverflow.com/questions/4489290/how-to-get-mac-desktop-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!