How to get rid of Enter Full Screen menu item?

前端 未结 2 1004
南旧
南旧 2021-01-22 05:27

In my Mac OS 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,

相关标签:
2条回答
  • 2021-01-22 05:43

    For Swift 4

    func applicationWillFinishLaunching(_ notification: Notification) {
        UserDefaults.standard.set(false, forKey: "NSFullScreenMenuItemEverywhere")
    }
    
    0 讨论(0)
  • 2021-01-22 05:49

    The release notes for AppKit for 10.11 suggest you can use the NSUserDefault NSFullScreenMenuItemEverywhere.

    Full Screen Menu Item

    AppKit automatically creates an "Enter Full Screen" menu item after the application finishes launching if an equivalent menu item isn't found. If this menu item should not be created for your app, before NSApplicationDidFinishLaunchingNotification is sent you may set the NSFullScreenMenuItemEverywhere default to NO.

    - (void)applicationWillFinishLaunching:(nonnull NSNotification *)notification {
        [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"];
    }
    
    0 讨论(0)
提交回复
热议问题