In my MacOS X app I deleted all default menu items, added my own. But in View
menu at the bottom I can still see Enter Full Screen
menu item, whilst in storyboard there is no such menu item. I've tried to delete entire View
menu, but now it migrated to Window
menu. Even though it's disabled, but still I would like to get rid of it, if possible.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The release notes for AppKit for 10.11 suggest you can use the NSUserDefault
NSFullScreenMenuItemEverywhere
.
- (void)applicationWillFinishLaunching:(nonnull NSNotification *)notification {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"]; }
回答2:
For Swift 4
func applicationWillFinishLaunching(_ notification: Notification) {
UserDefaults.standard.set(false, forKey: "NSFullScreenMenuItemEverywhere")
}