OS X的菜单中出现两个Enter Full Screen Bug修复


如果你在项目中自己定义了一个Enter Full Screen的按钮的话,那么在OS X 10.11中会出现两个Enter Full Screen的按钮,如下图所示:

OS X的菜单中出现两个Enter Full Screen Bug修复_第1张图片
截图

原因是,在OS X 10.11中,系统会自动生成一个Enter Full Screen的按钮,如果不需要系统自动生成的话,我们只需要在

- (void)applicationWillFinishLaunching:(nonnull NSNotification *)notification;

方法中添加如下代码即可:

[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"];

完整代码如下:

- (void)applicationWillFinishLaunching:(nonnull NSNotification *)notification {
    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"];
}

你可能感兴趣的:(OS X的菜单中出现两个Enter Full Screen Bug修复)