在我的MacOS X应用程序中,我删除了所有默认菜单项,添加了我自己的。但是在底部的View
菜单中,我仍然可以看到Enter Full Screen
菜单项,而在故事板中则没有这样的菜单项。我试图删除整个View
菜单,但现在它已迁移到Window
菜单。即使它已被禁用,但如果可能的话,我仍然希望摆脱它。
AppKit for 10.11的release notes建议你可以使用NSUserDefault
NSFullScreenMenuItemEverywhere
。
- (void)applicationWillFinishLaunching:(nonnull NSNotification *)notification {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"]; }
对于Swift 4
func applicationWillFinishLaunching(_ notification: Notification) {
UserDefaults.standard.set(false, forKey: "NSFullScreenMenuItemEverywhere")
}